/*
               File: Pedido
        Description: Pedido
             Author: GeneXus C# Generator version 10_2_4-75733
       Generated on: 7/17/2014 22:15:17.80
       Program type: Callable routine
          Main DBMS: sqlserver
*/
using System;
using System.Collections;
using GeneXus.Utils;
using GeneXus.Resources;
using GeneXus.Application;
using GeneXus.Metadata;
using System.Data;
using System.Data.SqlClient;
using GeneXus.Data;
using com.genexus;
using GeneXus.Data.ADO;
using GeneXus.Data.NTier;
using GeneXus.Data.NTier.ADO;
using System.Runtime.Remoting;
using GeneXus.WebControls;
using GeneXus.Http;
using GeneXus.XML;
using GeneXus.Search;
using GeneXus.Encryption;
using GeneXus.Http.Client;
using System.Xml.Serialization;
using System.Data.SqlTypes;
using System.ServiceModel;
using System.Runtime.Serialization;
namespace GeneXus.Programs {
   public class pedido : GXDataArea, System.Web.SessionState.IRequiresSessionState
   {
      protected void INITENV( )
      {
         if ( GxWebError != 0 )
         {
            return  ;
         }
      }

      protected void INITTRN( )
      {
         initialize_properties( ) ;
         entryPointCalled = false;
         gxfirstwebparm = GetNextPar( );
         gxfirstwebparm_bkp = gxfirstwebparm;
         gxfirstwebparm = DecryptAjaxCall( gxfirstwebparm);
         if ( StringUtil.StrCmp(gxfirstwebparm, "dyncall") == 0 )
         {
            setAjaxCallMode();
            if ( ! IsValidAjaxCall( true) )
            {
               GxWebError = 1;
               return  ;
            }
            dyncall( GetNextPar( )) ;
            return  ;
         }
         else if ( StringUtil.StrCmp(gxfirstwebparm, "gxajaxExecAct_"+"gxLoad_9") == 0 )
         {
            A1PedidoId = (long)(NumberUtil.Val( GetNextPar( ), "."));
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A1PedidoId", StringUtil.LTrim( StringUtil.Str( (decimal)(A1PedidoId), 10, 0)));
            setAjaxCallMode();
            if ( ! IsValidAjaxCall( true) )
            {
               GxWebError = 1;
               return  ;
            }
            gxLoad_9( A1PedidoId) ;
            return  ;
         }
         else if ( StringUtil.StrCmp(gxfirstwebparm, "gxajaxExecAct_"+"gxLoad_8") == 0 )
         {
            A6MesaId = (long)(NumberUtil.Val( GetNextPar( ), "."));
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A6MesaId", StringUtil.LTrim( StringUtil.Str( (decimal)(A6MesaId), 10, 0)));
            setAjaxCallMode();
            if ( ! IsValidAjaxCall( true) )
            {
               GxWebError = 1;
               return  ;
            }
            gxLoad_8( A6MesaId) ;
            return  ;
         }
         else if ( StringUtil.StrCmp(gxfirstwebparm, "gxajaxExecAct_"+"gxLoad_11") == 0 )
         {
            A16ProductoId = (long)(NumberUtil.Val( GetNextPar( ), "."));
            n16ProductoId = false;
            setAjaxCallMode();
            if ( ! IsValidAjaxCall( true) )
            {
               GxWebError = 1;
               return  ;
            }
            gxLoad_11( A16ProductoId) ;
            return  ;
         }
         else if ( StringUtil.StrCmp(gxfirstwebparm, "gxajaxExecAct_"+"gxLoad_12") == 0 )
         {
            A16ProductoId = (long)(NumberUtil.Val( GetNextPar( ), "."));
            n16ProductoId = false;
            setAjaxCallMode();
            if ( ! IsValidAjaxCall( true) )
            {
               GxWebError = 1;
               return  ;
            }
            gxLoad_12( A16ProductoId) ;
            return  ;
         }
         else if ( StringUtil.StrCmp(gxfirstwebparm, "gxajaxEvt") == 0 )
         {
            setAjaxEventMode();
            if ( ! IsValidAjaxCall( true) )
            {
               GxWebError = 1;
               return  ;
            }
            gxfirstwebparm = GetNextPar( );
         }
         else if ( StringUtil.StrCmp(gxfirstwebparm, "gxajaxNewRow_"+"Gridpedido_linea") == 0 )
         {
            nRC_Gridpedido_linea = (short)(NumberUtil.Val( GetNextPar( ), "."));
            nGXsfl_76_idx = (short)(NumberUtil.Val( GetNextPar( ), "."));
            sGXsfl_76_idx = GetNextPar( );
            setAjaxCallMode();
            if ( ! IsValidAjaxCall( true) )
            {
               GxWebError = 1;
               return  ;
            }
            gxnrGridpedido_linea_newrow( nRC_Gridpedido_linea, nGXsfl_76_idx, sGXsfl_76_idx) ;
            return  ;
         }
         else
         {
            if ( ! IsValidAjaxCall( false) )
            {
               GxWebError = 1;
               return  ;
            }
            gxfirstwebparm = gxfirstwebparm_bkp;
         }
         if ( String.IsNullOrEmpty(StringUtil.RTrim( context.GetCookie( "GX_SESSION_ID"))) )
         {
            gxcookieaux = context.SetCookie( "GX_SESSION_ID", Crypto.Encrypt64( Crypto.GetEncryptionKey( ), Crypto.GetServerKey( )), "", (DateTime)(DateTime.MinValue), "", 0);
         }
         GXKey = Crypto.Decrypt64( context.GetCookie( "GX_SESSION_ID"), Crypto.GetServerKey( ));
         Form.Meta.addItem("generator", "GeneXus C# 10_2_4-75733", 0) ;
         Form.Meta.addItem("description", "Pedido", 0) ;
         context.wjLoc = "";
         context.nUserReturn = 0;
         context.wbHandled = 0;
         if ( StringUtil.StrCmp(context.GetRequestMethod( ), "POST") == 0 )
         {
         }
         GX_FocusControl = edtPedidoId_Internalname;
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
         wbErr = false;
         context.SetDefaultTheme("GeneXusXEv2");
      }

      public pedido( )
      {
         context = new GxContext(  );
         DataStoreUtil.LoadDataStores( context);
         dsDefault = context.GetDataStore("Default");
         IsMain = true;
         context.SetDefaultTheme("GeneXusXEv2");
      }

      public pedido( IGxContext context )
      {
         this.context = context;
         IsMain = false;
         dsDefault = context.GetDataStore("Default");
      }

      public void release( )
      {
      }

      public void execute( )
      {
         executePrivate();
      }

      void executePrivate( )
      {
         isStatic = false;
         webExecute();
      }

      protected override void createObjects( )
      {
      }

      public override void webExecute( )
      {
         if ( initialized == 0 )
         {
            createObjects();
            initialize();
         }
         INITENV( ) ;
         INITTRN( ) ;
         if ( ( GxWebError == 0 ) && ! isAjaxCallMode( ) )
         {
            MasterPageObj = (GXMasterPage) ClassLoader.GetInstance("appmasterpage", "GeneXus.Programs.appmasterpage", new Object[] {new GxContext( context.handle, context.DataStores, context.HttpContext)});
            MasterPageObj.setDataArea(this,false);
            MasterPageObj.webExecute();
            if ( ( GxWebError == 0 ) && context.isAjaxRequest( ) )
            {
               enableOutput();
               if ( ! context.isAjaxRequest( ) )
               {
                  context.GX_webresponse.AppendHeader("Cache-Control", "max-age=0");
               }
               if ( String.IsNullOrEmpty(StringUtil.RTrim( context.wjLoc)) )
               {
                  context.GX_webresponse.AddString((String)(context.getJSONResponse( )));
               }
               else
               {
                  if ( context.isAjaxRequest( ) )
                  {
                     disableOutput();
                  }
                  RenderHtmlHeaders( ) ;
                  context.Redirect( context.wjLoc );
                  context.DispatchAjaxCommands();
               }
            }
         }
         this.cleanup();
      }

      protected void Draw( )
      {
         if ( context.isAjaxRequest( ) )
         {
            disableOutput();
         }
         if ( ! GxWebStd.gx_redirect( context) )
         {
            disable_std_buttons( ) ;
            enableDisable( ) ;
            set_caption( ) ;
            /* Form start */
            wb_table1_2_011( true) ;
         }
         return  ;
      }

      protected void wb_table1_2_011e( bool wbgen )
      {
         if ( wbgen )
         {
         }
         /* Execute Exit event if defined. */
      }

      protected void wb_table1_2_011( bool wbgen )
      {
         if ( wbgen )
         {
            /* Table start */
            sStyleString = "";
            GxWebStd.gx_table_start( context, tblTablemain_Internalname, tblTablemain_Internalname, "", "TableBorder100x100", 0, "", "", 1, 2, sStyleString, "", 0);
            context.WriteHtmlText( "<tbody>") ;
            context.WriteHtmlText( "<tr>") ;
            context.WriteHtmlText( "<td>") ;
            wb_table2_5_011( true) ;
         }
         return  ;
      }

      protected void wb_table2_5_011e( bool wbgen )
      {
         if ( wbgen )
         {
            /* Control Group */
            ClassString = "Group";
            StyleString = "";
            context.WriteHtmlText( "<fieldset id=\""+grpGroupdata_Internalname+"\""+" style=\"-moz-border-radius:3pt;\""+" class=\""+ClassString+"\">") ;
            context.WriteHtmlText( "<legend class=\""+ClassString+"Title"+"\">"+"Pedido"+"</legend>") ;
            wb_table3_28_011( true) ;
         }
         return  ;
      }

      protected void wb_table3_28_011e( bool wbgen )
      {
         if ( wbgen )
         {
            context.WriteHtmlText( "</fieldset>") ;
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "</tr>") ;
            context.WriteHtmlText( "</tbody>") ;
            /* End of table */
            context.WriteHtmlText( "</table>") ;
            wb_table1_2_011e( true) ;
         }
         else
         {
            wb_table1_2_011e( false) ;
         }
      }

      protected void wb_table3_28_011( bool wbgen )
      {
         if ( wbgen )
         {
            /* Table start */
            sStyleString = "";
            GxWebStd.gx_table_start( context, tblTable1_Internalname, tblTable1_Internalname, "", "Table", 0, "", "", 1, 2, sStyleString, "", 0);
            context.WriteHtmlText( "<tbody>") ;
            context.WriteHtmlText( "<tr>") ;
            context.WriteHtmlText( "<td>") ;
            ClassString = "ErrorViewer";
            StyleString = "";
            GxWebStd.gx_msg_list( context, "", context.GX_msglist.DisplayMode, StyleString, ClassString, "", "false");
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "</tr>") ;
            context.WriteHtmlText( "<tr>") ;
            context.WriteHtmlText( "<td>") ;
            wb_table4_34_011( true) ;
         }
         return  ;
      }

      protected void wb_table4_34_011e( bool wbgen )
      {
         if ( wbgen )
         {
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "</tr>") ;
            context.WriteHtmlText( "<tr>") ;
            context.WriteHtmlText( "<td>") ;
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 94,'',false,'',0)\"";
            ClassString = "BtnEnter";
            StyleString = "";
            GxWebStd.gx_button_ctrl( context, bttBtn_enter_Internalname, "", "Confirmar", bttBtn_enter_Jsonclick, 5, "Confirmar", "", StyleString, ClassString, bttBtn_enter_Visible, 1, "standard", "EENTER.", TempTags, "", context.GetButtonType( ), "HLP_Pedido.htm");
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 95,'',false,'',0)\"";
            ClassString = "BtnCancel";
            StyleString = "";
            GxWebStd.gx_button_ctrl( context, bttBtn_cancel_Internalname, "", "Cancelar", bttBtn_cancel_Jsonclick, 1, "Cancelar", "", StyleString, ClassString, bttBtn_cancel_Visible, 1, "standard", "ECANCEL.", TempTags, "", context.GetButtonType( ), "HLP_Pedido.htm");
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 96,'',false,'',0)\"";
            ClassString = "BtnDelete";
            StyleString = "";
            GxWebStd.gx_button_ctrl( context, bttBtn_delete_Internalname, "", "Eliminar", bttBtn_delete_Jsonclick, 5, "Eliminar", "", StyleString, ClassString, bttBtn_delete_Visible, 1, "standard", "EDELETE.", TempTags, "", context.GetButtonType( ), "HLP_Pedido.htm");
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "</tr>") ;
            context.WriteHtmlText( "</tbody>") ;
            /* End of table */
            context.WriteHtmlText( "</table>") ;
            wb_table3_28_011e( true) ;
         }
         else
         {
            wb_table3_28_011e( false) ;
         }
      }

      protected void wb_table4_34_011( bool wbgen )
      {
         if ( wbgen )
         {
            /* Table start */
            sStyleString = "";
            GxWebStd.gx_table_start( context, tblTable2_Internalname, tblTable2_Internalname, "", "Table", 0, "", "", 1, 2, sStyleString, "", 0);
            context.WriteHtmlText( "<tbody>") ;
            context.WriteHtmlText( "<tr>") ;
            context.WriteHtmlText( "<td class=\"td5\"  style=\"vertical-align:top\">") ;
            /* Text block */
            ClassString = "TextBlock";
            StyleString = "";
            GxWebStd.gx_label_ctrl( context, lblTextblockpedidoid_Internalname, "Id", "", "", lblTextblockpedidoid_Jsonclick, "", StyleString, ClassString, 0, "", 1, 1, 0, "HLP_Pedido.htm");
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "<td>") ;
            /* Single line edit */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 39,'',false,'',0)\"";
            ClassString = "Attribute";
            StyleString = "";
            GxWebStd.gx_single_line_edit( context, edtPedidoId_Internalname, StringUtil.LTrim( StringUtil.NToC( (decimal)(A1PedidoId), 10, 0, ",", "")), ((edtPedidoId_Enabled!=0) ? StringUtil.LTrim( context.localUtil.Format( (decimal)(A1PedidoId), "ZZZZZZZZZ9")) : context.localUtil.Format( (decimal)(A1PedidoId), "ZZZZZZZZZ9")), TempTags+" onchange=\"gx.evt.onchange(this)\" "+" onblur=\""+"gx.num.valid_integer( this,'.');"+";gx.evt.onblur(39);\"", "", "", "", "", "", edtPedidoId_Jsonclick, 0, ClassString, StyleString, "", 1, edtPedidoId_Enabled, 0, "text", "", 10, "chr", 1, "row", 10, 0, 0, 0, 1, -1, 0, true, "Id", "right", "HLP_Pedido.htm");
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "</tr>") ;
            context.WriteHtmlText( "<tr>") ;
            context.WriteHtmlText( "<td class=\"td5\"  style=\"vertical-align:top\">") ;
            /* Text block */
            ClassString = "TextBlock";
            StyleString = "";
            GxWebStd.gx_label_ctrl( context, lblTextblockpedidocantidadpersonas_Internalname, "Cantidad Personas", "", "", lblTextblockpedidocantidadpersonas_Jsonclick, "", StyleString, ClassString, 0, "", 1, 1, 0, "HLP_Pedido.htm");
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "<td>") ;
            /* Single line edit */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 44,'',false,'',0)\"";
            ClassString = "Attribute";
            StyleString = "";
            GxWebStd.gx_single_line_edit( context, edtPedidoCantidadPersonas_Internalname, StringUtil.LTrim( StringUtil.NToC( (decimal)(A53PedidoCantidadPersonas), 4, 0, ",", "")), ((edtPedidoCantidadPersonas_Enabled!=0) ? StringUtil.LTrim( context.localUtil.Format( (decimal)(A53PedidoCantidadPersonas), "ZZZ9")) : context.localUtil.Format( (decimal)(A53PedidoCantidadPersonas), "ZZZ9")), TempTags+" onchange=\"gx.evt.onchange(this)\" "+" onblur=\""+"gx.num.valid_integer( this,'.');"+";gx.evt.onblur(44);\"", "", "", "", "", "", edtPedidoCantidadPersonas_Jsonclick, 0, ClassString, StyleString, "", 1, edtPedidoCantidadPersonas_Enabled, 0, "text", "", 4, "chr", 1, "row", 4, 0, 0, 0, 1, -1, 0, true, "", "right", "HLP_Pedido.htm");
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "</tr>") ;
            context.WriteHtmlText( "<tr>") ;
            context.WriteHtmlText( "<td class=\"td5\"  style=\"vertical-align:top\">") ;
            /* Text block */
            ClassString = "TextBlock";
            StyleString = "";
            GxWebStd.gx_label_ctrl( context, lblTextblockpedidoestado_Internalname, "Estado", "", "", lblTextblockpedidoestado_Jsonclick, "", StyleString, ClassString, 0, "", 1, 1, 0, "HLP_Pedido.htm");
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "<td>") ;
            /* Single line edit */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 49,'',false,'',0)\"";
            ClassString = "Attribute";
            StyleString = "";
            GxWebStd.gx_single_line_edit( context, edtPedidoEstado_Internalname, StringUtil.RTrim( A54PedidoEstado), StringUtil.RTrim( context.localUtil.Format( A54PedidoEstado, "")), TempTags+" onchange=\"gx.evt.onchange(this)\" "+" onblur=\""+""+";gx.evt.onblur(49);\"", "", "", "", "", "", edtPedidoEstado_Jsonclick, 0, ClassString, StyleString, "", 1, edtPedidoEstado_Enabled, 0, "text", "", 1, "chr", 1, "row", 1, 0, 0, 0, 1, -1, -1, true, "Estado", "left", "HLP_Pedido.htm");
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "</tr>") ;
            context.WriteHtmlText( "<tr>") ;
            context.WriteHtmlText( "<td class=\"td5\"  style=\"vertical-align:top\">") ;
            /* Text block */
            ClassString = "TextBlock";
            StyleString = "";
            GxWebStd.gx_label_ctrl( context, lblTextblockpedidofhfin_Internalname, "FHFin", "", "", lblTextblockpedidofhfin_Jsonclick, "", StyleString, ClassString, 0, "", 1, 1, 0, "HLP_Pedido.htm");
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "<td>") ;
            /* Single line edit */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 54,'',false,'',0)\"";
            ClassString = "Attribute";
            StyleString = "";
            context.WriteHtmlText( "<div id=\""+edtPedidoFHFin_Internalname+"_dp_container\" class=\"dp_container\" style=\"white-space:nowrap;display:inline;\">") ;
            GxWebStd.gx_single_line_edit( context, edtPedidoFHFin_Internalname, context.localUtil.Format(A55PedidoFHFin, "99/99/99 99:99"), context.localUtil.Format( A55PedidoFHFin, "99/99/99 99:99"), TempTags+" onchange=\"gx.evt.onchange(this)\" "+" onblur=\""+"gx.date.valid_date(this, 8,'DMY',5,24,'spa',false,0);"+";gx.evt.onblur(54);\"", "", "", "", "", "", edtPedidoFHFin_Jsonclick, 0, ClassString, StyleString, "", 1, edtPedidoFHFin_Enabled, 0, "text", "", 14, "chr", 1, "row", 14, 0, 0, 0, 1, -1, 0, true, "", "right", "HLP_Pedido.htm");
            GxWebStd.gx_bitmap( context, edtPedidoFHFin_Internalname+"_dp_trigger", context.GetImagePath( "61b9b5d3-dff6-4d59-9b00-da61bc2cbe93", "", context.GetTheme( )), "", "", "", "", ((1==0)||(edtPedidoFHFin_Enabled==0) ? 0 : 1), 0, "Date selector", "Date selector", 0, 1, 0, "", 0, "", 0, 0, 0, "", "", "cursor: pointer;vertical-align:text-bottom", "", "", "", "", "", "", 1, false, false, "HLP_Pedido.htm");
            context.WriteHtmlTextNl( "</div>") ;
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "</tr>") ;
            context.WriteHtmlText( "<tr>") ;
            context.WriteHtmlText( "<td class=\"td5\"  style=\"vertical-align:top\">") ;
            /* Text block */
            ClassString = "TextBlock";
            StyleString = "";
            GxWebStd.gx_label_ctrl( context, lblTextblockpedidofhinicio_Internalname, "FHInicio", "", "", lblTextblockpedidofhinicio_Jsonclick, "", StyleString, ClassString, 0, "", 1, 1, 0, "HLP_Pedido.htm");
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "<td>") ;
            /* Single line edit */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 59,'',false,'',0)\"";
            ClassString = "Attribute";
            StyleString = "";
            context.WriteHtmlText( "<div id=\""+edtPedidoFHInicio_Internalname+"_dp_container\" class=\"dp_container\" style=\"white-space:nowrap;display:inline;\">") ;
            GxWebStd.gx_single_line_edit( context, edtPedidoFHInicio_Internalname, context.localUtil.Format(A56PedidoFHInicio, "99/99/99 99:99"), context.localUtil.Format( A56PedidoFHInicio, "99/99/99 99:99"), TempTags+" onchange=\"gx.evt.onchange(this)\" "+" onblur=\""+"gx.date.valid_date(this, 8,'DMY',5,24,'spa',false,0);"+";gx.evt.onblur(59);\"", "", "", "", "", "", edtPedidoFHInicio_Jsonclick, 0, ClassString, StyleString, "", 1, edtPedidoFHInicio_Enabled, 0, "text", "", 14, "chr", 1, "row", 14, 0, 0, 0, 1, -1, 0, true, "", "right", "HLP_Pedido.htm");
            GxWebStd.gx_bitmap( context, edtPedidoFHInicio_Internalname+"_dp_trigger", context.GetImagePath( "61b9b5d3-dff6-4d59-9b00-da61bc2cbe93", "", context.GetTheme( )), "", "", "", "", ((1==0)||(edtPedidoFHInicio_Enabled==0) ? 0 : 1), 0, "Date selector", "Date selector", 0, 1, 0, "", 0, "", 0, 0, 0, "", "", "cursor: pointer;vertical-align:text-bottom", "", "", "", "", "", "", 1, false, false, "HLP_Pedido.htm");
            context.WriteHtmlTextNl( "</div>") ;
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "</tr>") ;
            context.WriteHtmlText( "<tr>") ;
            context.WriteHtmlText( "<td class=\"td5\"  style=\"vertical-align:top\">") ;
            /* Text block */
            ClassString = "TextBlock";
            StyleString = "";
            GxWebStd.gx_label_ctrl( context, lblTextblockmesaid_Internalname, "Mesa Id", "", "", lblTextblockmesaid_Jsonclick, "", StyleString, ClassString, 0, "", 1, 1, 0, "HLP_Pedido.htm");
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "<td>") ;
            /* Single line edit */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 64,'',false,'',0)\"";
            ClassString = "Attribute";
            StyleString = "";
            GxWebStd.gx_single_line_edit( context, edtMesaId_Internalname, StringUtil.LTrim( StringUtil.NToC( (decimal)(A6MesaId), 10, 0, ",", "")), ((edtMesaId_Enabled!=0) ? StringUtil.LTrim( context.localUtil.Format( (decimal)(A6MesaId), "ZZZZZZZZZ9")) : context.localUtil.Format( (decimal)(A6MesaId), "ZZZZZZZZZ9")), TempTags+" onchange=\"gx.evt.onchange(this)\" "+" onblur=\""+"gx.num.valid_integer( this,'.');"+";gx.evt.onblur(64);\"", "", "", "", "", "", edtMesaId_Jsonclick, 0, ClassString, StyleString, "", 1, edtMesaId_Enabled, 0, "text", "", 10, "chr", 1, "row", 10, 0, 0, 0, 1, -1, 0, true, "Id", "right", "HLP_Pedido.htm");
            /* Static images/pictures */
            ClassString = "Image";
            StyleString = "";
            GxWebStd.gx_bitmap( context, imgprompt_6_Internalname, context.GetImagePath( "f5b04895-0024-488b-8e3b-b687ca4598ee", "", context.GetTheme( )), imgprompt_6_Link, "", "", context.GetTheme( ), imgprompt_6_Visible, 1, "", "", 0, 0, 0, "", 0, "", 0, 0, 0, "", "", StyleString, ClassString, "", "", "", "''", "", 1, false, false, "HLP_Pedido.htm");
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "</tr>") ;
            context.WriteHtmlText( "<tr>") ;
            context.WriteHtmlText( "<td class=\"td5\"  style=\"vertical-align:top\">") ;
            /* Text block */
            ClassString = "TextBlock";
            StyleString = "";
            GxWebStd.gx_label_ctrl( context, lblTextblockpedidotipo_Internalname, "Tipo", "", "", lblTextblockpedidotipo_Jsonclick, "", StyleString, ClassString, 0, "", 1, 1, 0, "HLP_Pedido.htm");
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "<td>") ;
            /* Single line edit */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 69,'',false,'',0)\"";
            ClassString = "Attribute";
            StyleString = "";
            GxWebStd.gx_single_line_edit( context, edtPedidoTipo_Internalname, StringUtil.RTrim( A57PedidoTipo), StringUtil.RTrim( context.localUtil.Format( A57PedidoTipo, "")), TempTags+" onchange=\"gx.evt.onchange(this)\" "+" onblur=\""+""+";gx.evt.onblur(69);\"", "", "", "", "", "", edtPedidoTipo_Jsonclick, 0, ClassString, StyleString, "", 1, edtPedidoTipo_Enabled, 0, "text", "", 20, "chr", 1, "row", 20, 0, 0, 0, 1, -1, -1, true, "", "left", "HLP_Pedido.htm");
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "</tr>") ;
            context.WriteHtmlText( "<tr>") ;
            context.WriteHtmlText( "<td colspan=\"2\" >") ;
            context.WriteHtmlText( "<br/>") ;
            wb_table5_72_011( true) ;
         }
         return  ;
      }

      protected void wb_table5_72_011e( bool wbgen )
      {
         if ( wbgen )
         {
            context.WriteHtmlText( "<hr class=\"HRDefault\"/>") ;
            /*  Grid Control  */
            Gridpedido_lineaContainer.AddObjectProperty("GridName", "Gridpedido_linea");
            Gridpedido_lineaContainer.AddObjectProperty("Class", "Grid");
            Gridpedido_lineaContainer.AddObjectProperty("Cellpadding", StringUtil.LTrim( StringUtil.NToC( (decimal)(1), 4, 0, ".", "")));
            Gridpedido_lineaContainer.AddObjectProperty("Cellspacing", StringUtil.LTrim( StringUtil.NToC( (decimal)(2), 4, 0, ".", "")));
            Gridpedido_lineaContainer.AddObjectProperty("Backcolorstyle", StringUtil.LTrim( StringUtil.NToC( (decimal)(subGridpedido_linea_Backcolorstyle), 1, 0, ".", "")));
            Gridpedido_lineaContainer.AddObjectProperty("CmpContext", "");
            Gridpedido_lineaContainer.AddObjectProperty("InMasterPage", "false");
            Gridpedido_lineaColumn = GXWebColumn.GetNew(isAjaxCallMode( ));
            Gridpedido_lineaColumn.AddObjectProperty("Value", StringUtil.LTrim( StringUtil.NToC( (decimal)(A9PedidoLineaId), 10, 0, ".", "")));
            Gridpedido_lineaColumn.AddObjectProperty("Enabled", StringUtil.LTrim( StringUtil.NToC( (decimal)(edtPedidoLineaId_Enabled), 5, 0, ".", "")));
            Gridpedido_lineaContainer.AddColumnProperties(Gridpedido_lineaColumn);
            Gridpedido_lineaColumn = GXWebColumn.GetNew(isAjaxCallMode( ));
            Gridpedido_lineaColumn.AddObjectProperty("Value", StringUtil.LTrim( StringUtil.NToC( (decimal)(A45PedidoLineaCantidad), 3, 0, ".", "")));
            Gridpedido_lineaColumn.AddObjectProperty("Enabled", StringUtil.LTrim( StringUtil.NToC( (decimal)(edtPedidoLineaCantidad_Enabled), 5, 0, ".", "")));
            Gridpedido_lineaContainer.AddColumnProperties(Gridpedido_lineaColumn);
            Gridpedido_lineaColumn = GXWebColumn.GetNew(isAjaxCallMode( ));
            Gridpedido_lineaColumn.AddObjectProperty("Value", StringUtil.RTrim( A46PedidoLineaComentarios));
            Gridpedido_lineaColumn.AddObjectProperty("Enabled", StringUtil.LTrim( StringUtil.NToC( (decimal)(edtPedidoLineaComentarios_Enabled), 5, 0, ".", "")));
            Gridpedido_lineaContainer.AddColumnProperties(Gridpedido_lineaColumn);
            Gridpedido_lineaColumn = GXWebColumn.GetNew(isAjaxCallMode( ));
            Gridpedido_lineaColumn.AddObjectProperty("Value", StringUtil.RTrim( A47PedidoLineaEstado));
            Gridpedido_lineaColumn.AddObjectProperty("Enabled", StringUtil.LTrim( StringUtil.NToC( (decimal)(edtPedidoLineaEstado_Enabled), 5, 0, ".", "")));
            Gridpedido_lineaContainer.AddColumnProperties(Gridpedido_lineaColumn);
            Gridpedido_lineaColumn = GXWebColumn.GetNew(isAjaxCallMode( ));
            Gridpedido_lineaColumn.AddObjectProperty("Value", context.localUtil.Format(A48PedidoLineaFHInicio, "99/99/99 99:99"));
            Gridpedido_lineaColumn.AddObjectProperty("Enabled", StringUtil.LTrim( StringUtil.NToC( (decimal)(edtPedidoLineaFHInicio_Enabled), 5, 0, ".", "")));
            Gridpedido_lineaContainer.AddColumnProperties(Gridpedido_lineaColumn);
            Gridpedido_lineaColumn = GXWebColumn.GetNew(isAjaxCallMode( ));
            Gridpedido_lineaColumn.AddObjectProperty("Value", context.localUtil.Format(A49PedidoLineaFHFin, "99/99/99 99:99"));
            Gridpedido_lineaColumn.AddObjectProperty("Enabled", StringUtil.LTrim( StringUtil.NToC( (decimal)(edtPedidoLineaFHFin_Enabled), 5, 0, ".", "")));
            Gridpedido_lineaContainer.AddColumnProperties(Gridpedido_lineaColumn);
            Gridpedido_lineaColumn = GXWebColumn.GetNew(isAjaxCallMode( ));
            Gridpedido_lineaColumn.AddObjectProperty("Value", StringUtil.LTrim( StringUtil.NToC( (decimal)(A50PedidoLineaPrioridad), 4, 0, ".", "")));
            Gridpedido_lineaColumn.AddObjectProperty("Enabled", StringUtil.LTrim( StringUtil.NToC( (decimal)(edtPedidoLineaPrioridad_Enabled), 5, 0, ".", "")));
            Gridpedido_lineaContainer.AddColumnProperties(Gridpedido_lineaColumn);
            Gridpedido_lineaColumn = GXWebColumn.GetNew(isAjaxCallMode( ));
            Gridpedido_lineaColumn.AddObjectProperty("Value", StringUtil.LTrim( StringUtil.NToC( (decimal)(A16ProductoId), 10, 0, ".", "")));
            Gridpedido_lineaColumn.AddObjectProperty("Enabled", StringUtil.LTrim( StringUtil.NToC( (decimal)(edtProductoId_Enabled), 5, 0, ".", "")));
            Gridpedido_lineaContainer.AddColumnProperties(Gridpedido_lineaColumn);
            Gridpedido_lineaColumn = GXWebColumn.GetNew(isAjaxCallMode( ));
            Gridpedido_lineaContainer.AddColumnProperties(Gridpedido_lineaColumn);
            Gridpedido_lineaColumn = GXWebColumn.GetNew(isAjaxCallMode( ));
            Gridpedido_lineaColumn.AddObjectProperty("Value", StringUtil.LTrim( StringUtil.NToC( A22ProductoPrecio, 5, 2, ".", "")));
            Gridpedido_lineaColumn.AddObjectProperty("Enabled", StringUtil.LTrim( StringUtil.NToC( (decimal)(edtProductoPrecio_Enabled), 5, 0, ".", "")));
            Gridpedido_lineaContainer.AddColumnProperties(Gridpedido_lineaColumn);
            Gridpedido_lineaColumn = GXWebColumn.GetNew(isAjaxCallMode( ));
            Gridpedido_lineaColumn.AddObjectProperty("Value", StringUtil.LTrim( StringUtil.NToC( A17LineaImporte, 5, 2, ".", "")));
            Gridpedido_lineaColumn.AddObjectProperty("Enabled", StringUtil.LTrim( StringUtil.NToC( (decimal)(edtLineaImporte_Enabled), 5, 0, ".", "")));
            Gridpedido_lineaContainer.AddColumnProperties(Gridpedido_lineaColumn);
            Gridpedido_lineaContainer.AddObjectProperty("Allowselection", StringUtil.LTrim( StringUtil.NToC( (decimal)(subGridpedido_linea_Allowselection), 1, 0, ".", "")));
            Gridpedido_lineaContainer.AddObjectProperty("Selectioncolor", StringUtil.LTrim( StringUtil.NToC( (decimal)(subGridpedido_linea_Selectioncolor), 9, 0, ".", "")));
            Gridpedido_lineaContainer.AddObjectProperty("Allowhover", StringUtil.LTrim( StringUtil.NToC( (decimal)(subGridpedido_linea_Allowhovering), 1, 0, ".", "")));
            Gridpedido_lineaContainer.AddObjectProperty("Hovercolor", StringUtil.LTrim( StringUtil.NToC( (decimal)(subGridpedido_linea_Hoveringcolor), 9, 0, ".", "")));
            Gridpedido_lineaContainer.AddObjectProperty("Allowcollapsing", StringUtil.LTrim( StringUtil.NToC( (decimal)(subGridpedido_linea_Allowcollapsing), 1, 0, ".", "")));
            Gridpedido_lineaContainer.AddObjectProperty("Collapsed", StringUtil.LTrim( StringUtil.NToC( (decimal)(subGridpedido_linea_Collapsed), 1, 0, ".", "")));
            nGXsfl_76_idx = 0;
            if ( ( nKeyPressed == 1 ) && ( AnyError == 0 ) )
            {
               /* Enter key processing. */
               nBlankRcdCount2 = 5;
               if ( StringUtil.StrCmp(Gx_mode, "INS") != 0 )
               {
                  /* Display confirmed (stored) records */
                  nRcdExists_2 = 1;
                  ScanStart012( ) ;
                  while ( RcdFound2 != 0 )
                  {
                     init_level_properties2( ) ;
                     getByPrimaryKey012( ) ;
                     AddRow012( ) ;
                     ScanNext012( ) ;
                  }
                  ScanEnd012( ) ;
                  nBlankRcdCount2 = 5;
               }
            }
            else if ( ( nKeyPressed == 3 ) || ( nKeyPressed == 4 ) || ( ( nKeyPressed == 1 ) && ( AnyError != 0 ) ) )
            {
               /* Button check  or addlines. */
               B8ImporteTotal = A8ImporteTotal;
               n8ImporteTotal = false;
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A8ImporteTotal", StringUtil.LTrim( StringUtil.Str( A8ImporteTotal, 5, 2)));
               standaloneNotModal012( ) ;
               standaloneModal012( ) ;
               sMode2 = Gx_mode;
               while ( nGXsfl_76_idx < nRC_Gridpedido_linea )
               {
                  ReadRow012( ) ;
                  edtPedidoLineaId_Enabled = (int)(context.localUtil.CToN( cgiGet( "PEDIDOLINEAID_"+sGXsfl_76_idx+"Enabled"), ",", "."));
                  edtPedidoLineaCantidad_Enabled = (int)(context.localUtil.CToN( cgiGet( "PEDIDOLINEACANTIDAD_"+sGXsfl_76_idx+"Enabled"), ",", "."));
                  edtPedidoLineaComentarios_Enabled = (int)(context.localUtil.CToN( cgiGet( "PEDIDOLINEACOMENTARIOS_"+sGXsfl_76_idx+"Enabled"), ",", "."));
                  edtPedidoLineaEstado_Enabled = (int)(context.localUtil.CToN( cgiGet( "PEDIDOLINEAESTADO_"+sGXsfl_76_idx+"Enabled"), ",", "."));
                  edtPedidoLineaFHInicio_Enabled = (int)(context.localUtil.CToN( cgiGet( "PEDIDOLINEAFHINICIO_"+sGXsfl_76_idx+"Enabled"), ",", "."));
                  edtPedidoLineaFHFin_Enabled = (int)(context.localUtil.CToN( cgiGet( "PEDIDOLINEAFHFIN_"+sGXsfl_76_idx+"Enabled"), ",", "."));
                  edtPedidoLineaPrioridad_Enabled = (int)(context.localUtil.CToN( cgiGet( "PEDIDOLINEAPRIORIDAD_"+sGXsfl_76_idx+"Enabled"), ",", "."));
                  edtProductoId_Enabled = (int)(context.localUtil.CToN( cgiGet( "PRODUCTOID_"+sGXsfl_76_idx+"Enabled"), ",", "."));
                  edtProductoPrecio_Enabled = (int)(context.localUtil.CToN( cgiGet( "PRODUCTOPRECIO_"+sGXsfl_76_idx+"Enabled"), ",", "."));
                  edtLineaImporte_Enabled = (int)(context.localUtil.CToN( cgiGet( "LINEAIMPORTE_"+sGXsfl_76_idx+"Enabled"), ",", "."));
                  imgprompt_6_Link = cgiGet( "PROMPT_16_"+sGXsfl_76_idx+"Link");
                  if ( ( nRcdExists_2 == 0 ) && ( StringUtil.StrCmp(Gx_mode, "INS") != 0 ) )
                  {
                     Gx_mode = "INS";
                     context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
                     standaloneModal012( ) ;
                  }
                  SendRow012( ) ;
               }
               Gx_mode = sMode2;
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
               A8ImporteTotal = B8ImporteTotal;
               n8ImporteTotal = false;
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A8ImporteTotal", StringUtil.LTrim( StringUtil.Str( A8ImporteTotal, 5, 2)));
            }
            else
            {
               /* Get or get-alike key processing. */
               nBlankRcdCount2 = 5;
               nRcdExists_2 = 1;
               ScanStart012( ) ;
               while ( RcdFound2 != 0 )
               {
                  init_level_properties2( ) ;
                  standaloneNotModal012( ) ;
                  getByPrimaryKey012( ) ;
                  standaloneModal012( ) ;
                  AddRow012( ) ;
                  ScanNext012( ) ;
               }
               ScanEnd012( ) ;
            }
            /* Initialize fields for 'new' records and send them. */
            sMode2 = Gx_mode;
            Gx_mode = "INS";
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
            InitAll012( ) ;
            init_level_properties2( ) ;
            B8ImporteTotal = A8ImporteTotal;
            n8ImporteTotal = false;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A8ImporteTotal", StringUtil.LTrim( StringUtil.Str( A8ImporteTotal, 5, 2)));
            standaloneNotModal012( ) ;
            standaloneModal012( ) ;
            nRcdExists_2 = 0;
            nIsMod_2 = 0;
            nBlankRcdCount2 = (short)(nBlankRcdUsr2+nBlankRcdCount2);
            fRowAdded = 0;
            while ( nBlankRcdCount2 > 0 )
            {
               AddRow012( ) ;
               if ( ( nKeyPressed == 4 ) && ( fRowAdded == 0 ) )
               {
                  fRowAdded = 1;
                  GX_FocusControl = edtPedidoLineaId_Internalname;
                  context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
               }
               nBlankRcdCount2 = (short)(nBlankRcdCount2-1);
            }
            Gx_mode = sMode2;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
            A8ImporteTotal = B8ImporteTotal;
            n8ImporteTotal = false;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A8ImporteTotal", StringUtil.LTrim( StringUtil.Str( A8ImporteTotal, 5, 2)));
            sStyleString = " style=\"display:none;\"";
            sStyleString = "";
            context.WriteHtmlText( "<div id=\""+"Gridpedido_lineaContainer"+"Div\" "+sStyleString+">"+"</div>") ;
            context.httpAjaxContext.ajax_rsp_assign_grid("_"+"Gridpedido_linea", (Object)(Gridpedido_lineaContainer));
            if ( ! context.isAjaxRequest( ) )
            {
               GxWebStd.gx_hidden_field( context, "Gridpedido_lineaContainerData", Gridpedido_lineaContainer.ToJavascriptSource());
            }
            if ( context.isAjaxRequest( ) )
            {
               GxWebStd.gx_hidden_field( context, "Gridpedido_lineaContainerData"+"V", Gridpedido_lineaContainer.GridValuesHidden());
            }
            else
            {
               context.WriteHtmlText( "<input type=\"hidden\" "+"name=\""+"Gridpedido_lineaContainerData"+"V"+"\" value='"+Gridpedido_lineaContainer.GridValuesHidden()+"'/>") ;
            }
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "</tr>") ;
            context.WriteHtmlText( "<tr>") ;
            context.WriteHtmlText( "<td class=\"td5\"  style=\"vertical-align:top\">") ;
            /* Text block */
            ClassString = "TextBlock";
            StyleString = "";
            GxWebStd.gx_label_ctrl( context, lblTextblockimportetotal_Internalname, "Total", "", "", lblTextblockimportetotal_Jsonclick, "", StyleString, ClassString, 0, "", 1, 1, 0, "HLP_Pedido.htm");
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "<td>") ;
            /* Single line edit */
            ClassString = "Attribute";
            StyleString = "";
            GxWebStd.gx_single_line_edit( context, edtImporteTotal_Internalname, StringUtil.LTrim( StringUtil.NToC( A8ImporteTotal, 5, 2, ",", "")), ((edtImporteTotal_Enabled!=0) ? StringUtil.LTrim( context.localUtil.Format( A8ImporteTotal, "Z9.99")) : context.localUtil.Format( A8ImporteTotal, "Z9.99")), "", "", "", "", "", "", edtImporteTotal_Jsonclick, 0, ClassString, StyleString, "", 1, edtImporteTotal_Enabled, 0, "text", "", 5, "chr", 1, "row", 5, 0, 0, 0, 1, -1, 0, true, "Importe", "right", "HLP_Pedido.htm");
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "</tr>") ;
            context.WriteHtmlText( "</tbody>") ;
            /* End of table */
            context.WriteHtmlText( "</table>") ;
            wb_table4_34_011e( true) ;
         }
         else
         {
            wb_table4_34_011e( false) ;
         }
      }

      protected void wb_table5_72_011( bool wbgen )
      {
         if ( wbgen )
         {
            /* Table start */
            sStyleString = "";
            GxWebStd.gx_table_start( context, tblTable3_Internalname, tblTable3_Internalname, "", "Table95", 0, "", "", 1, 2, sStyleString, "", 0);
            context.WriteHtmlText( "<tbody>") ;
            context.WriteHtmlText( "<tr>") ;
            context.WriteHtmlText( "<td class=\"SubTitle\" >") ;
            /* Text block */
            ClassString = "";
            StyleString = "";
            GxWebStd.gx_label_ctrl( context, lblTitlelinea_Internalname, "Linea", "", "", lblTitlelinea_Jsonclick, "", StyleString, ClassString, 0, "", 1, 1, 0, "HLP_Pedido.htm");
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "</tr>") ;
            context.WriteHtmlText( "</tbody>") ;
            /* End of table */
            context.WriteHtmlText( "</table>") ;
            wb_table5_72_011e( true) ;
         }
         else
         {
            wb_table5_72_011e( false) ;
         }
      }

      protected void wb_table2_5_011( bool wbgen )
      {
         if ( wbgen )
         {
            /* Table start */
            sStyleString = "";
            GxWebStd.gx_table_start( context, tblTabletoolbar_Internalname, tblTabletoolbar_Internalname, "", "ViewTable", 0, "", "", 1, 2, sStyleString, "", 0);
            context.WriteHtmlText( "<tbody>") ;
            context.WriteHtmlText( "<tr>") ;
            context.WriteHtmlText( "<td>") ;
            /* Div Control */
            ClassString = "ToolbarMain";
            StyleString = "";
            GxWebStd.gx_div_start( context, divSectiontoolbar_Internalname, 1, 0, "px", 0, "px", ClassString, "");
            /* Active images/pictures */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 9,'',false,'',0)\"";
            ClassString = "ImageHandCenter";
            StyleString = "";
            GxWebStd.gx_bitmap( context, imgBtn_first_Internalname, context.GetImagePath( "b9e06284-17ac-4c88-8937-5dbd84ad5d80", "", context.GetTheme( )), "", "", "", context.GetTheme( ), imgBtn_first_Visible, 1, "", "Primero", 0, 0, 0, "px", 0, "px", 0, 0, 5, imgBtn_first_Jsonclick, "EFIRST.", StyleString, ClassString, "", "", ""+TempTags, "", "", 1, false, false, "HLP_Pedido.htm");
            /* Active images/pictures */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 10,'',false,'',0)\"";
            ClassString = "ImageTop";
            StyleString = "";
            GxWebStd.gx_bitmap( context, imgBtn_first_separator_Internalname, context.GetImagePath( "ea7811ba-4fa2-42da-8591-e6cb10669f1f", "", context.GetTheme( )), "", "", "", context.GetTheme( ), imgBtn_first_separator_Visible, 1, "", "", 0, 0, 0, "px", 0, "px", 0, 0, 5, imgBtn_first_separator_Jsonclick, "EFIRST.", StyleString, ClassString, "", "", ""+TempTags, "", "", 1, false, false, "HLP_Pedido.htm");
            /* Active images/pictures */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 11,'',false,'',0)\"";
            ClassString = "ImageHandCenter";
            StyleString = "";
            GxWebStd.gx_bitmap( context, imgBtn_previous_Internalname, context.GetImagePath( "7d212604-db7b-4785-9c0d-5faffe71aa33", "", context.GetTheme( )), "", "", "", context.GetTheme( ), imgBtn_previous_Visible, 1, "", "Anterior", 0, 0, 0, "px", 0, "px", 0, 0, 5, imgBtn_previous_Jsonclick, "EPREVIOUS.", StyleString, ClassString, "", "", ""+TempTags, "", "", 1, false, false, "HLP_Pedido.htm");
            /* Active images/pictures */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 12,'',false,'',0)\"";
            ClassString = "ImageTop";
            StyleString = "";
            GxWebStd.gx_bitmap( context, imgBtn_previous_separator_Internalname, context.GetImagePath( "ea7811ba-4fa2-42da-8591-e6cb10669f1f", "", context.GetTheme( )), "", "", "", context.GetTheme( ), imgBtn_previous_separator_Visible, 1, "", "", 0, 0, 0, "px", 0, "px", 0, 0, 5, imgBtn_previous_separator_Jsonclick, "EPREVIOUS.", StyleString, ClassString, "", "", ""+TempTags, "", "", 1, false, false, "HLP_Pedido.htm");
            /* Active images/pictures */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 13,'',false,'',0)\"";
            ClassString = "ImageHandCenter";
            StyleString = "";
            GxWebStd.gx_bitmap( context, imgBtn_next_Internalname, context.GetImagePath( "1ae947cf-1354-41a9-8d59-d91daebf554f", "", context.GetTheme( )), "", "", "", context.GetTheme( ), imgBtn_next_Visible, 1, "", "Siguiente", 0, 0, 0, "px", 0, "px", 0, 0, 5, imgBtn_next_Jsonclick, "ENEXT.", StyleString, ClassString, "", "", ""+TempTags, "", "", 1, false, false, "HLP_Pedido.htm");
            /* Active images/pictures */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 14,'',false,'',0)\"";
            ClassString = "ImageTop";
            StyleString = "";
            GxWebStd.gx_bitmap( context, imgBtn_next_separator_Internalname, context.GetImagePath( "ea7811ba-4fa2-42da-8591-e6cb10669f1f", "", context.GetTheme( )), "", "", "", context.GetTheme( ), imgBtn_next_separator_Visible, 1, "", "", 0, 0, 0, "px", 0, "px", 0, 0, 5, imgBtn_next_separator_Jsonclick, "ENEXT.", StyleString, ClassString, "", "", ""+TempTags, "", "", 1, false, false, "HLP_Pedido.htm");
            /* Active images/pictures */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 15,'',false,'',0)\"";
            ClassString = "ImageHandCenter";
            StyleString = "";
            GxWebStd.gx_bitmap( context, imgBtn_last_Internalname, context.GetImagePath( "29211874-e613-48e5-9011-8017d984217e", "", context.GetTheme( )), "", "", "", context.GetTheme( ), imgBtn_last_Visible, 1, "", "Ultimo", 0, 0, 0, "px", 0, "px", 0, 0, 5, imgBtn_last_Jsonclick, "ELAST.", StyleString, ClassString, "", "", ""+TempTags, "", "", 1, false, false, "HLP_Pedido.htm");
            /* Active images/pictures */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 16,'',false,'',0)\"";
            ClassString = "ImageTop";
            StyleString = "";
            GxWebStd.gx_bitmap( context, imgBtn_last_separator_Internalname, context.GetImagePath( "ea7811ba-4fa2-42da-8591-e6cb10669f1f", "", context.GetTheme( )), "", "", "", context.GetTheme( ), imgBtn_last_separator_Visible, 1, "", "", 0, 0, 0, "px", 0, "px", 0, 0, 5, imgBtn_last_separator_Jsonclick, "ELAST.", StyleString, ClassString, "", "", ""+TempTags, "", "", 1, false, false, "HLP_Pedido.htm");
            /* Active images/pictures */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 17,'',false,'',0)\"";
            ClassString = "ImageHandCenter";
            StyleString = "";
            GxWebStd.gx_bitmap( context, imgBtn_select_Internalname, context.GetImagePath( "1ca03f75-9947-4d2c-90a4-e8ab9c5cedea", "", context.GetTheme( )), "", "", "", context.GetTheme( ), imgBtn_select_Visible, 1, "", "Seleccionar", 0, 0, 0, "px", 0, "px", 0, 0, 4, imgBtn_select_Jsonclick, "ESELECT.", StyleString, ClassString, "", "", ""+TempTags, "", "gx.popup.openPrompt('"+"gx0010.aspx"+"',["+"{Ctrl:gx.dom.el('"+"PEDIDOID"+"'), id:'"+"PEDIDOID"+"'"+",IOType:'out',isKey:true,isLastKey:true}"+"],"+"null"+","+"'', false"+","+"true"+");"+"return false;", 1, false, false, "HLP_Pedido.htm");
            /* Active images/pictures */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 18,'',false,'',0)\"";
            ClassString = "ImageTop";
            StyleString = "";
            GxWebStd.gx_bitmap( context, imgBtn_select_separator_Internalname, context.GetImagePath( "ea7811ba-4fa2-42da-8591-e6cb10669f1f", "", context.GetTheme( )), "", "", "", context.GetTheme( ), imgBtn_select_separator_Visible, 1, "", "", 0, 0, 0, "px", 0, "px", 0, 0, 4, imgBtn_select_separator_Jsonclick, "ESELECT.", StyleString, ClassString, "", "", ""+TempTags, "", "gx.popup.openPrompt('"+"gx0010.aspx"+"',["+"{Ctrl:gx.dom.el('"+"PEDIDOID"+"'), id:'"+"PEDIDOID"+"'"+",IOType:'out',isKey:true,isLastKey:true}"+"],"+"null"+","+"'', false"+","+"true"+");"+"return false;", 1, false, false, "HLP_Pedido.htm");
            /* Active images/pictures */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 19,'',false,'',0)\"";
            ClassString = "ImageHandCenter";
            StyleString = "";
            GxWebStd.gx_bitmap( context, imgBtn_enter2_Internalname, context.GetImagePath( "2061cf2c-bd33-4433-a13e-34af954142e9", "", context.GetTheme( )), "", "", "", context.GetTheme( ), imgBtn_enter2_Visible, imgBtn_enter2_Enabled, "", "Confirmar", 0, 0, 0, "px", 0, "px", 0, 0, 5, imgBtn_enter2_Jsonclick, "EENTER.", StyleString, ClassString, "", "", ""+TempTags, "", "", 1, false, false, "HLP_Pedido.htm");
            /* Active images/pictures */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 20,'',false,'',0)\"";
            ClassString = "ImageTop";
            StyleString = "";
            GxWebStd.gx_bitmap( context, imgBtn_enter2_separator_Internalname, context.GetImagePath( "ea7811ba-4fa2-42da-8591-e6cb10669f1f", "", context.GetTheme( )), "", "", "", context.GetTheme( ), imgBtn_enter2_separator_Visible, 1, "", "", 0, 0, 0, "px", 0, "px", 0, 0, 5, imgBtn_enter2_separator_Jsonclick, "EENTER.", StyleString, ClassString, "", "", ""+TempTags, "", "", 1, false, false, "HLP_Pedido.htm");
            /* Active images/pictures */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 21,'',false,'',0)\"";
            ClassString = "ImageHandCenter";
            StyleString = "";
            GxWebStd.gx_bitmap( context, imgBtn_cancel2_Internalname, context.GetImagePath( "0e94ced8-bc34-47ff-9a53-bc683736a686", "", context.GetTheme( )), "", "", "", context.GetTheme( ), imgBtn_cancel2_Visible, 1, "", "Cancelar", 0, 0, 0, "px", 0, "px", 0, 0, 1, imgBtn_cancel2_Jsonclick, "ECANCEL.", StyleString, ClassString, "", "", ""+TempTags, "", "", 1, false, false, "HLP_Pedido.htm");
            /* Active images/pictures */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 22,'',false,'',0)\"";
            ClassString = "ImageTop";
            StyleString = "";
            GxWebStd.gx_bitmap( context, imgBtn_cancel2_separator_Internalname, context.GetImagePath( "ea7811ba-4fa2-42da-8591-e6cb10669f1f", "", context.GetTheme( )), "", "", "", context.GetTheme( ), imgBtn_cancel2_separator_Visible, 1, "", "", 0, 0, 0, "px", 0, "px", 0, 0, 1, imgBtn_cancel2_separator_Jsonclick, "ECANCEL.", StyleString, ClassString, "", "", ""+TempTags, "", "", 1, false, false, "HLP_Pedido.htm");
            /* Active images/pictures */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 23,'',false,'',0)\"";
            ClassString = "ImageHandCenter";
            StyleString = "";
            GxWebStd.gx_bitmap( context, imgBtn_delete2_Internalname, context.GetImagePath( "7695fe89-52c9-4b7e-871e-0e11548f823e", "", context.GetTheme( )), "", "", "", context.GetTheme( ), imgBtn_delete2_Visible, imgBtn_delete2_Enabled, "", "Eliminar", 0, 0, 0, "px", 0, "px", 0, 0, 5, imgBtn_delete2_Jsonclick, "EDELETE.", StyleString, ClassString, "", "", ""+TempTags, "", "", 1, false, false, "HLP_Pedido.htm");
            /* Active images/pictures */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 24,'',false,'',0)\"";
            ClassString = "ImageTop";
            StyleString = "";
            GxWebStd.gx_bitmap( context, imgBtn_delete2_separator_Internalname, context.GetImagePath( "ea7811ba-4fa2-42da-8591-e6cb10669f1f", "", context.GetTheme( )), "", "", "", context.GetTheme( ), imgBtn_delete2_separator_Visible, 1, "", "", 0, 0, 0, "px", 0, "px", 0, 0, 5, imgBtn_delete2_separator_Jsonclick, "EDELETE.", StyleString, ClassString, "", "", ""+TempTags, "", "", 1, false, false, "HLP_Pedido.htm");
            context.WriteHtmlText( "</div>") ;
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "</tr>") ;
            context.WriteHtmlText( "<tr>") ;
            context.WriteHtmlText( "<td>") ;
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "</tr>") ;
            context.WriteHtmlText( "</tbody>") ;
            /* End of table */
            context.WriteHtmlText( "</table>") ;
            wb_table2_5_011e( true) ;
         }
         else
         {
            wb_table2_5_011e( false) ;
         }
      }

      protected void UserMain( )
      {
         standaloneStartup( ) ;
      }

      protected void standaloneStartup( )
      {
         standaloneStartupServer( ) ;
         disable_std_buttons( ) ;
         enableDisable( ) ;
         Process( ) ;
      }

      protected void standaloneStartupServer( )
      {
         /* Execute Start event if defined. */
         context.wbGlbDoneStart = 0;
         context.wbGlbDoneStart = 1;
         assign_properties_default( ) ;
         if ( AnyError == 0 )
         {
            if ( StringUtil.StrCmp(context.GetRequestMethod( ), "POST") == 0 )
            {
               /* Read saved SDTs. */
               /* Read variables values. */
               if ( ( ( context.localUtil.CToN( cgiGet( edtPedidoId_Internalname), ",", ".") < Convert.ToDecimal( 0 )) ) || ( ( context.localUtil.CToN( cgiGet( edtPedidoId_Internalname), ",", ".") > Convert.ToDecimal( 9999999999L )) ) )
               {
                  GX_msglist.addItem(context.GetMessage( "GXM_badnum", ""), 1, "PEDIDOID");
                  AnyError = 1;
                  GX_FocusControl = edtPedidoId_Internalname;
                  context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
                  wbErr = true;
                  A1PedidoId = 0;
                  context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A1PedidoId", StringUtil.LTrim( StringUtil.Str( (decimal)(A1PedidoId), 10, 0)));
               }
               else
               {
                  A1PedidoId = (long)(context.localUtil.CToN( cgiGet( edtPedidoId_Internalname), ",", "."));
                  context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A1PedidoId", StringUtil.LTrim( StringUtil.Str( (decimal)(A1PedidoId), 10, 0)));
               }
               if ( ( ( context.localUtil.CToN( cgiGet( edtPedidoCantidadPersonas_Internalname), ",", ".") < Convert.ToDecimal( 0 )) ) || ( ( context.localUtil.CToN( cgiGet( edtPedidoCantidadPersonas_Internalname), ",", ".") > Convert.ToDecimal( 9999 )) ) )
               {
                  GX_msglist.addItem(context.GetMessage( "GXM_badnum", ""), 1, "PEDIDOCANTIDADPERSONAS");
                  AnyError = 1;
                  GX_FocusControl = edtPedidoCantidadPersonas_Internalname;
                  context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
                  wbErr = true;
                  A53PedidoCantidadPersonas = 0;
                  context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A53PedidoCantidadPersonas", StringUtil.LTrim( StringUtil.Str( (decimal)(A53PedidoCantidadPersonas), 4, 0)));
               }
               else
               {
                  A53PedidoCantidadPersonas = (short)(context.localUtil.CToN( cgiGet( edtPedidoCantidadPersonas_Internalname), ",", "."));
                  context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A53PedidoCantidadPersonas", StringUtil.LTrim( StringUtil.Str( (decimal)(A53PedidoCantidadPersonas), 4, 0)));
               }
               A54PedidoEstado = cgiGet( edtPedidoEstado_Internalname);
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A54PedidoEstado", A54PedidoEstado);
               if ( context.localUtil.VCDateTime( cgiGet( edtPedidoFHFin_Internalname), 2, 0) == 0 )
               {
                  GX_msglist.addItem(context.GetMessage( "GXM_baddatetime", new   object[]  {"Pedido FHFin"}), 1, "PEDIDOFHFIN");
                  AnyError = 1;
                  GX_FocusControl = edtPedidoFHFin_Internalname;
                  context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
                  wbErr = true;
                  A55PedidoFHFin = (DateTime)(DateTime.MinValue);
                  context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A55PedidoFHFin", context.localUtil.TToC( A55PedidoFHFin, 8, 5, 0, 3, "/", ":", " "));
               }
               else
               {
                  A55PedidoFHFin = context.localUtil.CToT( cgiGet( edtPedidoFHFin_Internalname));
                  context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A55PedidoFHFin", context.localUtil.TToC( A55PedidoFHFin, 8, 5, 0, 3, "/", ":", " "));
               }
               if ( context.localUtil.VCDateTime( cgiGet( edtPedidoFHInicio_Internalname), 2, 0) == 0 )
               {
                  GX_msglist.addItem(context.GetMessage( "GXM_baddatetime", new   object[]  {"Pedido FHInicio"}), 1, "PEDIDOFHINICIO");
                  AnyError = 1;
                  GX_FocusControl = edtPedidoFHInicio_Internalname;
                  context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
                  wbErr = true;
                  A56PedidoFHInicio = (DateTime)(DateTime.MinValue);
                  context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A56PedidoFHInicio", context.localUtil.TToC( A56PedidoFHInicio, 8, 5, 0, 3, "/", ":", " "));
               }
               else
               {
                  A56PedidoFHInicio = context.localUtil.CToT( cgiGet( edtPedidoFHInicio_Internalname));
                  context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A56PedidoFHInicio", context.localUtil.TToC( A56PedidoFHInicio, 8, 5, 0, 3, "/", ":", " "));
               }
               if ( ( ( context.localUtil.CToN( cgiGet( edtMesaId_Internalname), ",", ".") < Convert.ToDecimal( 0 )) ) || ( ( context.localUtil.CToN( cgiGet( edtMesaId_Internalname), ",", ".") > Convert.ToDecimal( 9999999999L )) ) )
               {
                  GX_msglist.addItem(context.GetMessage( "GXM_badnum", ""), 1, "MESAID");
                  AnyError = 1;
                  GX_FocusControl = edtMesaId_Internalname;
                  context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
                  wbErr = true;
                  A6MesaId = 0;
                  context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A6MesaId", StringUtil.LTrim( StringUtil.Str( (decimal)(A6MesaId), 10, 0)));
               }
               else
               {
                  A6MesaId = (long)(context.localUtil.CToN( cgiGet( edtMesaId_Internalname), ",", "."));
                  context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A6MesaId", StringUtil.LTrim( StringUtil.Str( (decimal)(A6MesaId), 10, 0)));
               }
               A57PedidoTipo = cgiGet( edtPedidoTipo_Internalname);
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A57PedidoTipo", A57PedidoTipo);
               A8ImporteTotal = context.localUtil.CToN( cgiGet( edtImporteTotal_Internalname), ",", ".");
               n8ImporteTotal = false;
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A8ImporteTotal", StringUtil.LTrim( StringUtil.Str( A8ImporteTotal, 5, 2)));
               /* Read saved values. */
               Z1PedidoId = (long)(context.localUtil.CToN( cgiGet( "Z1PedidoId"), ",", "."));
               Z53PedidoCantidadPersonas = (short)(context.localUtil.CToN( cgiGet( "Z53PedidoCantidadPersonas"), ",", "."));
               Z54PedidoEstado = cgiGet( "Z54PedidoEstado");
               Z55PedidoFHFin = context.localUtil.CToT( cgiGet( "Z55PedidoFHFin"), 0);
               Z56PedidoFHInicio = context.localUtil.CToT( cgiGet( "Z56PedidoFHInicio"), 0);
               Z57PedidoTipo = cgiGet( "Z57PedidoTipo");
               Z6MesaId = (long)(context.localUtil.CToN( cgiGet( "Z6MesaId"), ",", "."));
               O8ImporteTotal = context.localUtil.CToN( cgiGet( "O8ImporteTotal"), ",", ".");
               IsConfirmed = (short)(context.localUtil.CToN( cgiGet( "IsConfirmed"), ",", "."));
               IsModified = (short)(context.localUtil.CToN( cgiGet( "IsModified"), ",", "."));
               Gx_mode = cgiGet( "Mode");
               nRC_Gridpedido_linea = (short)(context.localUtil.CToN( cgiGet( "nRC_Gridpedido_linea"), ",", "."));
               Gx_mode = cgiGet( "vMODE");
               /* Read subfile selected row values. */
               /* Read hidden variables. */
               GXKey = Crypto.Decrypt64( context.GetCookie( "GX_SESSION_ID"), Crypto.GetServerKey( ));
               /* Check if conditions changed and reset current page numbers */
               standaloneNotModal( ) ;
            }
            else
            {
               standaloneNotModal( ) ;
               if ( StringUtil.StrCmp(gxfirstwebparm, "viewer") == 0 )
               {
                  Gx_mode = "DSP";
                  context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
                  A1PedidoId = (long)(NumberUtil.Val( GetNextPar( ), "."));
                  context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A1PedidoId", StringUtil.LTrim( StringUtil.Str( (decimal)(A1PedidoId), 10, 0)));
                  getEqualNoModal( ) ;
                  Gx_mode = "DSP";
                  context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
                  disable_std_buttons_dsp( ) ;
                  standaloneModal( ) ;
               }
               else
               {
                  Gx_mode = "INS";
                  context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
                  standaloneModal( ) ;
               }
            }
         }
      }

      protected void Process( )
      {
         if ( StringUtil.StrCmp(context.GetRequestMethod( ), "POST") == 0 )
         {
            /* Read Transaction buttons. */
            sEvt = cgiGet( "_EventName");
            EvtGridId = cgiGet( "_EventGridId");
            EvtRowId = cgiGet( "_EventRowId");
            if ( StringUtil.Len( sEvt) > 0 )
            {
               sEvtType = StringUtil.Left( sEvt, 1);
               sEvt = StringUtil.Right( sEvt, (short)(StringUtil.Len( sEvt)-1));
               if ( StringUtil.StrCmp(sEvtType, "M") != 0 )
               {
                  if ( StringUtil.StrCmp(sEvtType, "E") == 0 )
                  {
                     sEvtType = StringUtil.Right( sEvt, 1);
                     if ( StringUtil.StrCmp(sEvtType, ".") == 0 )
                     {
                        sEvt = StringUtil.Left( sEvt, (short)(StringUtil.Len( sEvt)-1));
                        if ( StringUtil.StrCmp(sEvt, "ENTER") == 0 )
                        {
                           context.wbHandled = 1;
                           btn_enter( ) ;
                           /* No code required for Cancel button. It is implemented as the Reset button. */
                        }
                        else if ( StringUtil.StrCmp(sEvt, "FIRST") == 0 )
                        {
                           context.wbHandled = 1;
                           btn_first( ) ;
                        }
                        else if ( StringUtil.StrCmp(sEvt, "PREVIOUS") == 0 )
                        {
                           context.wbHandled = 1;
                           btn_previous( ) ;
                        }
                        else if ( StringUtil.StrCmp(sEvt, "NEXT") == 0 )
                        {
                           context.wbHandled = 1;
                           btn_next( ) ;
                        }
                        else if ( StringUtil.StrCmp(sEvt, "LAST") == 0 )
                        {
                           context.wbHandled = 1;
                           btn_last( ) ;
                        }
                        else if ( StringUtil.StrCmp(sEvt, "SELECT") == 0 )
                        {
                           context.wbHandled = 1;
                           btn_select( ) ;
                        }
                        else if ( StringUtil.StrCmp(sEvt, "DELETE") == 0 )
                        {
                           context.wbHandled = 1;
                           btn_delete( ) ;
                        }
                        else if ( StringUtil.StrCmp(sEvt, "LSCR") == 0 )
                        {
                           context.wbHandled = 1;
                           AfterKeyLoadScreen( ) ;
                        }
                     }
                     else
                     {
                        sEvtType = StringUtil.Right( sEvt, 4);
                        sEvt = StringUtil.Left( sEvt, (short)(StringUtil.Len( sEvt)-4));
                     }
                  }
                  context.wbHandled = 1;
               }
            }
         }
      }

      protected void AfterTrn( )
      {
         if ( trnEnded == 1 )
         {
            trnEnded = 0;
            standaloneNotModal( ) ;
            standaloneModal( ) ;
            if ( ( StringUtil.StrCmp(Gx_mode, "INS") == 0 )  )
            {
               /* Clear variables for new insertion. */
               InitAll011( ) ;
               standaloneNotModal( ) ;
               standaloneModal( ) ;
            }
         }
      }

      public override String ToString( )
      {
         return "" ;
      }

      public GxContentInfo GetContentInfo( )
      {
         return (GxContentInfo)(null) ;
      }

      protected void disable_std_buttons( )
      {
         if ( StringUtil.StrCmp(Gx_mode, "INS") == 0 )
         {
            imgBtn_delete2_Enabled = 0;
            context.httpAjaxContext.ajax_rsp_assign_prop("", false, imgBtn_delete2_Internalname, "Enabled", StringUtil.LTrim( StringUtil.Str( (decimal)(imgBtn_delete2_Enabled), 5, 0)));
         }
      }

      protected void disable_std_buttons_dsp( )
      {
         imgBtn_delete2_Visible = 0;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, imgBtn_delete2_Internalname, "Visible", StringUtil.LTrim( StringUtil.Str( (decimal)(imgBtn_delete2_Visible), 5, 0)));
         imgBtn_delete2_separator_Visible = 0;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, imgBtn_delete2_separator_Internalname, "Visible", StringUtil.LTrim( StringUtil.Str( (decimal)(imgBtn_delete2_separator_Visible), 5, 0)));
         bttBtn_delete_Visible = 0;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, bttBtn_delete_Internalname, "Visible", StringUtil.LTrim( StringUtil.Str( (decimal)(bttBtn_delete_Visible), 5, 0)));
         imgBtn_first_Visible = 0;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, imgBtn_first_Internalname, "Visible", StringUtil.LTrim( StringUtil.Str( (decimal)(imgBtn_first_Visible), 5, 0)));
         imgBtn_first_separator_Visible = 0;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, imgBtn_first_separator_Internalname, "Visible", StringUtil.LTrim( StringUtil.Str( (decimal)(imgBtn_first_separator_Visible), 5, 0)));
         imgBtn_previous_Visible = 0;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, imgBtn_previous_Internalname, "Visible", StringUtil.LTrim( StringUtil.Str( (decimal)(imgBtn_previous_Visible), 5, 0)));
         imgBtn_previous_separator_Visible = 0;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, imgBtn_previous_separator_Internalname, "Visible", StringUtil.LTrim( StringUtil.Str( (decimal)(imgBtn_previous_separator_Visible), 5, 0)));
         imgBtn_next_Visible = 0;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, imgBtn_next_Internalname, "Visible", StringUtil.LTrim( StringUtil.Str( (decimal)(imgBtn_next_Visible), 5, 0)));
         imgBtn_next_separator_Visible = 0;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, imgBtn_next_separator_Internalname, "Visible", StringUtil.LTrim( StringUtil.Str( (decimal)(imgBtn_next_separator_Visible), 5, 0)));
         imgBtn_last_Visible = 0;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, imgBtn_last_Internalname, "Visible", StringUtil.LTrim( StringUtil.Str( (decimal)(imgBtn_last_Visible), 5, 0)));
         imgBtn_last_separator_Visible = 0;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, imgBtn_last_separator_Internalname, "Visible", StringUtil.LTrim( StringUtil.Str( (decimal)(imgBtn_last_separator_Visible), 5, 0)));
         imgBtn_select_Visible = 0;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, imgBtn_select_Internalname, "Visible", StringUtil.LTrim( StringUtil.Str( (decimal)(imgBtn_select_Visible), 5, 0)));
         imgBtn_select_separator_Visible = 0;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, imgBtn_select_separator_Internalname, "Visible", StringUtil.LTrim( StringUtil.Str( (decimal)(imgBtn_select_separator_Visible), 5, 0)));
         imgBtn_delete2_Visible = 0;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, imgBtn_delete2_Internalname, "Visible", StringUtil.LTrim( StringUtil.Str( (decimal)(imgBtn_delete2_Visible), 5, 0)));
         imgBtn_delete2_separator_Visible = 0;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, imgBtn_delete2_separator_Internalname, "Visible", StringUtil.LTrim( StringUtil.Str( (decimal)(imgBtn_delete2_separator_Visible), 5, 0)));
         bttBtn_delete_Visible = 0;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, bttBtn_delete_Internalname, "Visible", StringUtil.LTrim( StringUtil.Str( (decimal)(bttBtn_delete_Visible), 5, 0)));
         if ( StringUtil.StrCmp(Gx_mode, "DSP") == 0 )
         {
            imgBtn_enter2_Visible = 0;
            context.httpAjaxContext.ajax_rsp_assign_prop("", false, imgBtn_enter2_Internalname, "Visible", StringUtil.LTrim( StringUtil.Str( (decimal)(imgBtn_enter2_Visible), 5, 0)));
            imgBtn_enter2_separator_Visible = 0;
            context.httpAjaxContext.ajax_rsp_assign_prop("", false, imgBtn_enter2_separator_Internalname, "Visible", StringUtil.LTrim( StringUtil.Str( (decimal)(imgBtn_enter2_separator_Visible), 5, 0)));
            bttBtn_enter_Visible = 0;
            context.httpAjaxContext.ajax_rsp_assign_prop("", false, bttBtn_enter_Internalname, "Visible", StringUtil.LTrim( StringUtil.Str( (decimal)(bttBtn_enter_Visible), 5, 0)));
         }
         DisableAttributes011( ) ;
      }

      protected void set_caption( )
      {
         if ( ( IsConfirmed == 1 ) && ( AnyError == 0 ) )
         {
            if ( StringUtil.StrCmp(Gx_mode, "DLT") == 0 )
            {
               GX_msglist.addItem(context.GetMessage( "GXM_confdelete", ""), 0, "");
            }
            else
            {
               GX_msglist.addItem(context.GetMessage( "GXM_mustconfirm", ""), 0, "");
            }
         }
      }

      protected void CONFIRM_012( )
      {
         s8ImporteTotal = O8ImporteTotal;
         n8ImporteTotal = false;
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A8ImporteTotal", StringUtil.LTrim( StringUtil.Str( A8ImporteTotal, 5, 2)));
         nGXsfl_76_idx = 0;
         while ( nGXsfl_76_idx < nRC_Gridpedido_linea )
         {
            ReadRow012( ) ;
            if ( ( nRcdExists_2 != 0 ) || ( nIsMod_2 != 0 ) )
            {
               GetKey012( ) ;
               if ( ( nRcdExists_2 == 0 ) && ( nRcdDeleted_2 == 0 ) )
               {
                  if ( RcdFound2 == 0 )
                  {
                     Gx_mode = "INS";
                     context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
                     BeforeValidate012( ) ;
                     if ( AnyError == 0 )
                     {
                        CheckExtendedTable012( ) ;
                        CloseExtendedTableCursors012( ) ;
                        if ( AnyError == 0 )
                        {
                           IsConfirmed = 1;
                        }
                        O8ImporteTotal = A8ImporteTotal;
                        n8ImporteTotal = false;
                        context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A8ImporteTotal", StringUtil.LTrim( StringUtil.Str( A8ImporteTotal, 5, 2)));
                     }
                  }
                  else
                  {
                     GX_msglist.addItem(context.GetMessage( "GXM_noupdate", ""), "DuplicatePrimaryKey", 1, "PEDIDOLINEAID");
                     AnyError = 1;
                     GX_FocusControl = edtPedidoLineaId_Internalname;
                     context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
                  }
               }
               else
               {
                  if ( RcdFound2 != 0 )
                  {
                     if ( nRcdDeleted_2 != 0 )
                     {
                        Gx_mode = "DLT";
                        context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
                        getByPrimaryKey012( ) ;
                        Load012( ) ;
                        BeforeValidate012( ) ;
                        if ( AnyError == 0 )
                        {
                           OnDeleteControls012( ) ;
                           O8ImporteTotal = A8ImporteTotal;
                           n8ImporteTotal = false;
                           context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A8ImporteTotal", StringUtil.LTrim( StringUtil.Str( A8ImporteTotal, 5, 2)));
                        }
                     }
                     else
                     {
                        if ( nIsMod_2 != 0 )
                        {
                           Gx_mode = "UPD";
                           context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
                           BeforeValidate012( ) ;
                           if ( AnyError == 0 )
                           {
                              CheckExtendedTable012( ) ;
                              CloseExtendedTableCursors012( ) ;
                              if ( AnyError == 0 )
                              {
                                 IsConfirmed = 1;
                              }
                              O8ImporteTotal = A8ImporteTotal;
                              n8ImporteTotal = false;
                              context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A8ImporteTotal", StringUtil.LTrim( StringUtil.Str( A8ImporteTotal, 5, 2)));
                           }
                        }
                     }
                  }
                  else
                  {
                     if ( nRcdDeleted_2 == 0 )
                     {
                        GX_msglist.addItem(context.GetMessage( "GXM_recdeleted", ""), 1, "PEDIDOLINEAID");
                        AnyError = 1;
                        GX_FocusControl = edtPedidoLineaId_Internalname;
                        context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
                     }
                  }
               }
            }
            ChangePostValue( edtPedidoLineaId_Internalname, StringUtil.LTrim( StringUtil.NToC( (decimal)(A9PedidoLineaId), 10, 0, ",", ""))) ;
            ChangePostValue( edtPedidoLineaCantidad_Internalname, StringUtil.LTrim( StringUtil.NToC( (decimal)(A45PedidoLineaCantidad), 3, 0, ",", ""))) ;
            ChangePostValue( edtPedidoLineaComentarios_Internalname, StringUtil.RTrim( A46PedidoLineaComentarios)) ;
            ChangePostValue( edtPedidoLineaEstado_Internalname, StringUtil.RTrim( A47PedidoLineaEstado)) ;
            ChangePostValue( edtPedidoLineaFHInicio_Internalname, context.localUtil.Format(A48PedidoLineaFHInicio, "99/99/99 99:99")) ;
            ChangePostValue( edtPedidoLineaFHFin_Internalname, context.localUtil.Format(A49PedidoLineaFHFin, "99/99/99 99:99")) ;
            ChangePostValue( edtPedidoLineaPrioridad_Internalname, StringUtil.LTrim( StringUtil.NToC( (decimal)(A50PedidoLineaPrioridad), 4, 0, ",", ""))) ;
            ChangePostValue( edtProductoId_Internalname, StringUtil.LTrim( StringUtil.NToC( (decimal)(A16ProductoId), 10, 0, ",", ""))) ;
            ChangePostValue( edtProductoPrecio_Internalname, StringUtil.LTrim( StringUtil.NToC( A22ProductoPrecio, 5, 2, ",", ""))) ;
            ChangePostValue( edtLineaImporte_Internalname, StringUtil.LTrim( StringUtil.NToC( A17LineaImporte, 5, 2, ",", ""))) ;
            ChangePostValue( "ZT_"+"Z9PedidoLineaId_"+sGXsfl_76_idx, StringUtil.LTrim( StringUtil.NToC( (decimal)(Z9PedidoLineaId), 10, 0, ",", ""))) ;
            ChangePostValue( "ZT_"+"Z45PedidoLineaCantidad_"+sGXsfl_76_idx, StringUtil.LTrim( StringUtil.NToC( (decimal)(Z45PedidoLineaCantidad), 3, 0, ",", ""))) ;
            ChangePostValue( "ZT_"+"Z46PedidoLineaComentarios_"+sGXsfl_76_idx, StringUtil.RTrim( Z46PedidoLineaComentarios)) ;
            ChangePostValue( "ZT_"+"Z47PedidoLineaEstado_"+sGXsfl_76_idx, StringUtil.RTrim( Z47PedidoLineaEstado)) ;
            ChangePostValue( "ZT_"+"Z48PedidoLineaFHInicio_"+sGXsfl_76_idx, context.localUtil.TToC( Z48PedidoLineaFHInicio, 10, 8, 0, 0, "/", ":", " ")) ;
            ChangePostValue( "ZT_"+"Z49PedidoLineaFHFin_"+sGXsfl_76_idx, context.localUtil.TToC( Z49PedidoLineaFHFin, 10, 8, 0, 0, "/", ":", " ")) ;
            ChangePostValue( "ZT_"+"Z50PedidoLineaPrioridad_"+sGXsfl_76_idx, StringUtil.LTrim( StringUtil.NToC( (decimal)(Z50PedidoLineaPrioridad), 4, 0, ",", ""))) ;
            ChangePostValue( "ZT_"+"Z16ProductoId_"+sGXsfl_76_idx, StringUtil.LTrim( StringUtil.NToC( (decimal)(Z16ProductoId), 10, 0, ",", ""))) ;
            ChangePostValue( "T17LineaImporte_"+sGXsfl_76_idx, StringUtil.LTrim( StringUtil.NToC( O17LineaImporte, 5, 2, ",", ""))) ;
            ChangePostValue( "nRcdDeleted_2_"+sGXsfl_76_idx, StringUtil.LTrim( StringUtil.NToC( (decimal)(nRcdDeleted_2), 4, 0, ",", ""))) ;
            ChangePostValue( "nRcdExists_2_"+sGXsfl_76_idx, StringUtil.LTrim( StringUtil.NToC( (decimal)(nRcdExists_2), 4, 0, ",", ""))) ;
            ChangePostValue( "nIsMod_2_"+sGXsfl_76_idx, StringUtil.LTrim( StringUtil.NToC( (decimal)(nIsMod_2), 4, 0, ",", ""))) ;
            if ( nIsMod_2 != 0 )
            {
               ChangePostValue( "PEDIDOLINEAID_"+sGXsfl_76_idx+"Enabled", StringUtil.LTrim( StringUtil.NToC( (decimal)(edtPedidoLineaId_Enabled), 5, 0, ".", ""))) ;
               ChangePostValue( "PEDIDOLINEACANTIDAD_"+sGXsfl_76_idx+"Enabled", StringUtil.LTrim( StringUtil.NToC( (decimal)(edtPedidoLineaCantidad_Enabled), 5, 0, ".", ""))) ;
               ChangePostValue( "PEDIDOLINEACOMENTARIOS_"+sGXsfl_76_idx+"Enabled", StringUtil.LTrim( StringUtil.NToC( (decimal)(edtPedidoLineaComentarios_Enabled), 5, 0, ".", ""))) ;
               ChangePostValue( "PEDIDOLINEAESTADO_"+sGXsfl_76_idx+"Enabled", StringUtil.LTrim( StringUtil.NToC( (decimal)(edtPedidoLineaEstado_Enabled), 5, 0, ".", ""))) ;
               ChangePostValue( "PEDIDOLINEAFHINICIO_"+sGXsfl_76_idx+"Enabled", StringUtil.LTrim( StringUtil.NToC( (decimal)(edtPedidoLineaFHInicio_Enabled), 5, 0, ".", ""))) ;
               ChangePostValue( "PEDIDOLINEAFHFIN_"+sGXsfl_76_idx+"Enabled", StringUtil.LTrim( StringUtil.NToC( (decimal)(edtPedidoLineaFHFin_Enabled), 5, 0, ".", ""))) ;
               ChangePostValue( "PEDIDOLINEAPRIORIDAD_"+sGXsfl_76_idx+"Enabled", StringUtil.LTrim( StringUtil.NToC( (decimal)(edtPedidoLineaPrioridad_Enabled), 5, 0, ".", ""))) ;
               ChangePostValue( "PRODUCTOID_"+sGXsfl_76_idx+"Enabled", StringUtil.LTrim( StringUtil.NToC( (decimal)(edtProductoId_Enabled), 5, 0, ".", ""))) ;
               ChangePostValue( "PRODUCTOPRECIO_"+sGXsfl_76_idx+"Enabled", StringUtil.LTrim( StringUtil.NToC( (decimal)(edtProductoPrecio_Enabled), 5, 0, ".", ""))) ;
               ChangePostValue( "LINEAIMPORTE_"+sGXsfl_76_idx+"Enabled", StringUtil.LTrim( StringUtil.NToC( (decimal)(edtLineaImporte_Enabled), 5, 0, ".", ""))) ;
            }
         }
         O8ImporteTotal = s8ImporteTotal;
         n8ImporteTotal = false;
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A8ImporteTotal", StringUtil.LTrim( StringUtil.Str( A8ImporteTotal, 5, 2)));
         /* Start of After( level) rules */
         /* End of After( level) rules */
      }

      protected void ResetCaption010( )
      {
      }

      protected void ZM011( short GX_JID )
      {
         if ( ( GX_JID == 7 ) || ( GX_JID == 0 ) )
         {
            if ( StringUtil.StrCmp(Gx_mode, "INS") != 0 )
            {
               Z53PedidoCantidadPersonas = T00018_A53PedidoCantidadPersonas[0];
               Z54PedidoEstado = T00018_A54PedidoEstado[0];
               Z55PedidoFHFin = T00018_A55PedidoFHFin[0];
               Z56PedidoFHInicio = T00018_A56PedidoFHInicio[0];
               Z57PedidoTipo = T00018_A57PedidoTipo[0];
               Z6MesaId = T00018_A6MesaId[0];
            }
            else
            {
               Z53PedidoCantidadPersonas = A53PedidoCantidadPersonas;
               Z54PedidoEstado = A54PedidoEstado;
               Z55PedidoFHFin = A55PedidoFHFin;
               Z56PedidoFHInicio = A56PedidoFHInicio;
               Z57PedidoTipo = A57PedidoTipo;
               Z6MesaId = A6MesaId;
            }
         }
         if ( GX_JID == -7 )
         {
            Z1PedidoId = A1PedidoId;
            Z53PedidoCantidadPersonas = A53PedidoCantidadPersonas;
            Z54PedidoEstado = A54PedidoEstado;
            Z55PedidoFHFin = A55PedidoFHFin;
            Z56PedidoFHInicio = A56PedidoFHInicio;
            Z57PedidoTipo = A57PedidoTipo;
            Z6MesaId = A6MesaId;
            Z8ImporteTotal = A8ImporteTotal;
         }
      }

      protected void standaloneNotModal( )
      {
         imgprompt_6_Link = ((StringUtil.StrCmp(Gx_mode, "DSP")==0) ? "" : "javascript:"+"gx.popup.openPrompt('"+"gx0030.aspx"+"',["+"{Ctrl:gx.dom.el('"+"MESAID"+"'), id:'"+"MESAID"+"'"+",IOType:'out'}"+"],"+"null"+","+"'', false"+","+"false"+");");
      }

      protected void standaloneModal( )
      {
         if ( StringUtil.StrCmp(Gx_mode, "INS") == 0 )
         {
            imgBtn_delete2_Enabled = 0;
            context.httpAjaxContext.ajax_rsp_assign_prop("", false, imgBtn_delete2_Internalname, "Enabled", StringUtil.LTrim( StringUtil.Str( (decimal)(imgBtn_delete2_Enabled), 5, 0)));
         }
         else
         {
            imgBtn_delete2_Enabled = 1;
            context.httpAjaxContext.ajax_rsp_assign_prop("", false, imgBtn_delete2_Internalname, "Enabled", StringUtil.LTrim( StringUtil.Str( (decimal)(imgBtn_delete2_Enabled), 5, 0)));
         }
         if ( StringUtil.StrCmp(Gx_mode, "DSP") == 0 )
         {
            imgBtn_enter2_Enabled = 0;
            context.httpAjaxContext.ajax_rsp_assign_prop("", false, imgBtn_enter2_Internalname, "Enabled", StringUtil.LTrim( StringUtil.Str( (decimal)(imgBtn_enter2_Enabled), 5, 0)));
         }
         else
         {
            imgBtn_enter2_Enabled = 1;
            context.httpAjaxContext.ajax_rsp_assign_prop("", false, imgBtn_enter2_Internalname, "Enabled", StringUtil.LTrim( StringUtil.Str( (decimal)(imgBtn_enter2_Enabled), 5, 0)));
         }
      }

      protected void Load011( )
      {
         /* Using cursor T000117 */
         pr_default.execute(8, new Object[] {A1PedidoId});
         if ( (pr_default.getStatus(8) != 101) )
         {
            RcdFound1 = 1;
            A53PedidoCantidadPersonas = T000117_A53PedidoCantidadPersonas[0];
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A53PedidoCantidadPersonas", StringUtil.LTrim( StringUtil.Str( (decimal)(A53PedidoCantidadPersonas), 4, 0)));
            A54PedidoEstado = T000117_A54PedidoEstado[0];
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A54PedidoEstado", A54PedidoEstado);
            A55PedidoFHFin = T000117_A55PedidoFHFin[0];
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A55PedidoFHFin", context.localUtil.TToC( A55PedidoFHFin, 8, 5, 0, 3, "/", ":", " "));
            A56PedidoFHInicio = T000117_A56PedidoFHInicio[0];
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A56PedidoFHInicio", context.localUtil.TToC( A56PedidoFHInicio, 8, 5, 0, 3, "/", ":", " "));
            A57PedidoTipo = T000117_A57PedidoTipo[0];
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A57PedidoTipo", A57PedidoTipo);
            A6MesaId = T000117_A6MesaId[0];
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A6MesaId", StringUtil.LTrim( StringUtil.Str( (decimal)(A6MesaId), 10, 0)));
            A8ImporteTotal = T000117_A8ImporteTotal[0];
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A8ImporteTotal", StringUtil.LTrim( StringUtil.Str( A8ImporteTotal, 5, 2)));
            n8ImporteTotal = T000117_n8ImporteTotal[0];
            ZM011( -7) ;
         }
         pr_default.close(8);
         OnLoadActions011( ) ;
      }

      protected void OnLoadActions011( )
      {
         O8ImporteTotal = A8ImporteTotal;
         n8ImporteTotal = false;
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A8ImporteTotal", StringUtil.LTrim( StringUtil.Str( A8ImporteTotal, 5, 2)));
      }

      protected void CheckExtendedTable011( )
      {
         Gx_BScreen = 1;
         standaloneModal( ) ;
         /* Using cursor T000113 */
         pr_default.execute(7, new Object[] {A1PedidoId});
         if ( (pr_default.getStatus(7) != 101) )
         {
            A8ImporteTotal = T000113_A8ImporteTotal[0];
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A8ImporteTotal", StringUtil.LTrim( StringUtil.Str( A8ImporteTotal, 5, 2)));
            n8ImporteTotal = T000113_n8ImporteTotal[0];
         }
         else
         {
            A8ImporteTotal = 0;
            n8ImporteTotal = false;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A8ImporteTotal", StringUtil.LTrim( StringUtil.Str( A8ImporteTotal, 5, 2)));
         }
         pr_default.close(7);
         if ( ! ( (DateTime.MinValue==A55PedidoFHFin) || ( A55PedidoFHFin >= context.localUtil.YMDHMSToT( 1753, 1, 1, 0, 0, 0) ) ) )
         {
            GX_msglist.addItem("Campo Pedido FHFin fuera de rango", "OutOfRange", 1, "PEDIDOFHFIN");
            AnyError = 1;
            GX_FocusControl = edtPedidoFHFin_Internalname;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
         }
         if ( ! ( (DateTime.MinValue==A56PedidoFHInicio) || ( A56PedidoFHInicio >= context.localUtil.YMDHMSToT( 1753, 1, 1, 0, 0, 0) ) ) )
         {
            GX_msglist.addItem("Campo Pedido FHInicio fuera de rango", "OutOfRange", 1, "PEDIDOFHINICIO");
            AnyError = 1;
            GX_FocusControl = edtPedidoFHInicio_Internalname;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
         }
         /* Using cursor T00019 */
         pr_default.execute(6, new Object[] {A6MesaId});
         if ( (pr_default.getStatus(6) == 101) )
         {
            GX_msglist.addItem("No existe 'Mesa'.", "ForeignKeyNotFound", 1, "MESAID");
            AnyError = 1;
            GX_FocusControl = edtMesaId_Internalname;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
         }
         pr_default.close(6);
      }

      protected void CloseExtendedTableCursors011( )
      {
         pr_default.close(7);
         pr_default.close(6);
      }

      protected void enableDisable( )
      {
      }

      protected void gxLoad_9( long A1PedidoId )
      {
         /* Using cursor T000121 */
         pr_default.execute(9, new Object[] {A1PedidoId});
         if ( (pr_default.getStatus(9) != 101) )
         {
            A8ImporteTotal = T000121_A8ImporteTotal[0];
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A8ImporteTotal", StringUtil.LTrim( StringUtil.Str( A8ImporteTotal, 5, 2)));
            n8ImporteTotal = T000121_n8ImporteTotal[0];
         }
         else
         {
            A8ImporteTotal = 0;
            n8ImporteTotal = false;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A8ImporteTotal", StringUtil.LTrim( StringUtil.Str( A8ImporteTotal, 5, 2)));
         }
         GxWebStd.set_html_headers( context, 0, "", "");
         context.GX_webresponse.AddString("new Array( new Array(");
         context.GX_webresponse.AddString("\""+GXUtil.EncodeJSConstant( StringUtil.LTrim( StringUtil.NToC( A8ImporteTotal, 5, 2, ".", "")))+"\"");
         context.GX_webresponse.AddString(")");
         if ( (pr_default.getStatus(9) == 101) )
         {
            context.GX_webresponse.AddString(",");
            context.GX_webresponse.AddString("101");
         }
         context.GX_webresponse.AddString(")");
         pr_default.close(9);
      }

      protected void gxLoad_8( long A6MesaId )
      {
         /* Using cursor T000122 */
         pr_default.execute(10, new Object[] {A6MesaId});
         if ( (pr_default.getStatus(10) == 101) )
         {
            GX_msglist.addItem("No existe 'Mesa'.", "ForeignKeyNotFound", 1, "MESAID");
            AnyError = 1;
            GX_FocusControl = edtMesaId_Internalname;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
         }
         GxWebStd.set_html_headers( context, 0, "", "");
         context.GX_webresponse.AddString("new Array( new Array(");
         context.GX_webresponse.AddString("");
         context.GX_webresponse.AddString(")");
         if ( (pr_default.getStatus(10) == 101) )
         {
            context.GX_webresponse.AddString(",");
            context.GX_webresponse.AddString("101");
         }
         context.GX_webresponse.AddString(")");
         pr_default.close(10);
      }

      protected void GetKey011( )
      {
         /* Using cursor T000123 */
         pr_default.execute(11, new Object[] {A1PedidoId});
         if ( (pr_default.getStatus(11) != 101) )
         {
            RcdFound1 = 1;
         }
         else
         {
            RcdFound1 = 0;
         }
         pr_default.close(11);
      }

      protected void getByPrimaryKey( )
      {
         /* Using cursor T00018 */
         pr_default.execute(5, new Object[] {A1PedidoId});
         if ( (pr_default.getStatus(5) != 101) )
         {
            ZM011( 7) ;
            RcdFound1 = 1;
            A1PedidoId = T00018_A1PedidoId[0];
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A1PedidoId", StringUtil.LTrim( StringUtil.Str( (decimal)(A1PedidoId), 10, 0)));
            A53PedidoCantidadPersonas = T00018_A53PedidoCantidadPersonas[0];
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A53PedidoCantidadPersonas", StringUtil.LTrim( StringUtil.Str( (decimal)(A53PedidoCantidadPersonas), 4, 0)));
            A54PedidoEstado = T00018_A54PedidoEstado[0];
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A54PedidoEstado", A54PedidoEstado);
            A55PedidoFHFin = T00018_A55PedidoFHFin[0];
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A55PedidoFHFin", context.localUtil.TToC( A55PedidoFHFin, 8, 5, 0, 3, "/", ":", " "));
            A56PedidoFHInicio = T00018_A56PedidoFHInicio[0];
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A56PedidoFHInicio", context.localUtil.TToC( A56PedidoFHInicio, 8, 5, 0, 3, "/", ":", " "));
            A57PedidoTipo = T00018_A57PedidoTipo[0];
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A57PedidoTipo", A57PedidoTipo);
            A6MesaId = T00018_A6MesaId[0];
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A6MesaId", StringUtil.LTrim( StringUtil.Str( (decimal)(A6MesaId), 10, 0)));
            Z1PedidoId = A1PedidoId;
            sMode1 = Gx_mode;
            Gx_mode = "DSP";
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
            standaloneModal( ) ;
            Load011( ) ;
            if ( AnyError == 1 )
            {
               RcdFound1 = 0;
               InitializeNonKey011( ) ;
            }
            Gx_mode = sMode1;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
         }
         else
         {
            RcdFound1 = 0;
            InitializeNonKey011( ) ;
            sMode1 = Gx_mode;
            Gx_mode = "DSP";
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
            standaloneModal( ) ;
            Gx_mode = sMode1;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
         }
         pr_default.close(5);
      }

      protected void getEqualNoModal( )
      {
         GetKey011( ) ;
         if ( RcdFound1 == 0 )
         {
            Gx_mode = "INS";
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
         }
         else
         {
            Gx_mode = "UPD";
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
         }
         getByPrimaryKey( ) ;
      }

      protected void move_next( )
      {
         RcdFound1 = 0;
         /* Using cursor T000124 */
         pr_default.execute(12, new Object[] {A1PedidoId});
         if ( (pr_default.getStatus(12) != 101) )
         {
            while ( (pr_default.getStatus(12) != 101) && ( ( T000124_A1PedidoId[0] < A1PedidoId ) ) )
            {
               pr_default.readNext(12);
            }
            if ( (pr_default.getStatus(12) != 101) && ( ( T000124_A1PedidoId[0] > A1PedidoId ) ) )
            {
               A1PedidoId = T000124_A1PedidoId[0];
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A1PedidoId", StringUtil.LTrim( StringUtil.Str( (decimal)(A1PedidoId), 10, 0)));
               RcdFound1 = 1;
            }
         }
         pr_default.close(5);
      }

      protected void move_previous( )
      {
         RcdFound1 = 0;
         /* Using cursor T000125 */
         pr_default.execute(13, new Object[] {A1PedidoId});
         if ( (pr_default.getStatus(13) != 101) )
         {
            while ( (pr_default.getStatus(13) != 101) && ( ( T000125_A1PedidoId[0] > A1PedidoId ) ) )
            {
               pr_default.readNext(13);
            }
            if ( (pr_default.getStatus(13) != 101) && ( ( T000125_A1PedidoId[0] < A1PedidoId ) ) )
            {
               A1PedidoId = T000125_A1PedidoId[0];
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A1PedidoId", StringUtil.LTrim( StringUtil.Str( (decimal)(A1PedidoId), 10, 0)));
               RcdFound1 = 1;
            }
         }
         pr_default.close(4);
      }

      protected void btn_enter( )
      {
         nKeyPressed = 1;
         GetKey011( ) ;
         if ( RcdFound1 == 1 )
         {
            if ( StringUtil.StrCmp(Gx_mode, "INS") == 0 )
            {
               GX_msglist.addItem(context.GetMessage( "GXM_noupdate", ""), "DuplicatePrimaryKey", 1, "PEDIDOID");
               AnyError = 1;
               GX_FocusControl = edtPedidoId_Internalname;
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
            }
            else if ( A1PedidoId != Z1PedidoId )
            {
               A1PedidoId = Z1PedidoId;
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A1PedidoId", StringUtil.LTrim( StringUtil.Str( (decimal)(A1PedidoId), 10, 0)));
               GX_msglist.addItem(context.GetMessage( "GXM_getbeforeupd", ""), "CandidateKeyNotFound", 1, "PEDIDOID");
               AnyError = 1;
               GX_FocusControl = edtPedidoId_Internalname;
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
            }
            else if ( StringUtil.StrCmp(Gx_mode, "DLT") == 0 )
            {
               A8ImporteTotal = O8ImporteTotal;
               n8ImporteTotal = false;
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A8ImporteTotal", StringUtil.LTrim( StringUtil.Str( A8ImporteTotal, 5, 2)));
               delete( ) ;
               AfterTrn( ) ;
               GX_FocusControl = edtPedidoId_Internalname;
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
            }
            else
            {
               Gx_mode = "UPD";
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
               /* Update record */
               A8ImporteTotal = O8ImporteTotal;
               n8ImporteTotal = false;
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A8ImporteTotal", StringUtil.LTrim( StringUtil.Str( A8ImporteTotal, 5, 2)));
               Update011( ) ;
               GX_FocusControl = edtPedidoId_Internalname;
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
            }
         }
         else
         {
            if ( A1PedidoId != Z1PedidoId )
            {
               Gx_mode = "INS";
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
               /* Insert record */
               A8ImporteTotal = O8ImporteTotal;
               n8ImporteTotal = false;
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A8ImporteTotal", StringUtil.LTrim( StringUtil.Str( A8ImporteTotal, 5, 2)));
               GX_FocusControl = edtPedidoId_Internalname;
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
               Insert011( ) ;
               if ( AnyError == 1 )
               {
                  GX_FocusControl = "";
                  context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
               }
            }
            else
            {
               if ( StringUtil.StrCmp(Gx_mode, "UPD") == 0 )
               {
                  GX_msglist.addItem(context.GetMessage( "GXM_recdeleted", ""), 1, "PEDIDOID");
                  AnyError = 1;
                  GX_FocusControl = edtPedidoId_Internalname;
                  context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
               }
               else
               {
                  Gx_mode = "INS";
                  context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
                  /* Insert record */
                  A8ImporteTotal = O8ImporteTotal;
                  n8ImporteTotal = false;
                  context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A8ImporteTotal", StringUtil.LTrim( StringUtil.Str( A8ImporteTotal, 5, 2)));
                  GX_FocusControl = edtPedidoId_Internalname;
                  context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
                  Insert011( ) ;
                  if ( AnyError == 1 )
                  {
                     GX_FocusControl = "";
                     context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
                  }
               }
            }
         }
         AfterTrn( ) ;
      }

      protected void btn_delete( )
      {
         if ( A1PedidoId != Z1PedidoId )
         {
            A1PedidoId = Z1PedidoId;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A1PedidoId", StringUtil.LTrim( StringUtil.Str( (decimal)(A1PedidoId), 10, 0)));
            GX_msglist.addItem(context.GetMessage( "GXM_getbeforedlt", ""), 1, "PEDIDOID");
            AnyError = 1;
            GX_FocusControl = edtPedidoId_Internalname;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
         }
         else
         {
            A8ImporteTotal = O8ImporteTotal;
            n8ImporteTotal = false;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A8ImporteTotal", StringUtil.LTrim( StringUtil.Str( A8ImporteTotal, 5, 2)));
            delete( ) ;
            AfterTrn( ) ;
            GX_FocusControl = edtPedidoId_Internalname;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
         }
         if ( AnyError != 0 )
         {
            Gx_mode = "UPD";
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
         }
         else
         {
            getByPrimaryKey( ) ;
         }
         CloseOpenCursors();
      }

      protected void btn_get( )
      {
         nKeyPressed = 2;
         IsConfirmed = 0;
         getEqualNoModal( ) ;
         if ( RcdFound1 == 0 )
         {
            GX_msglist.addItem(context.GetMessage( "GXM_keynfound", ""), "PrimaryKeyNotFound", 1, "PEDIDOID");
            AnyError = 1;
         }
         GX_FocusControl = edtPedidoCantidadPersonas_Internalname;
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
         standaloneNotModal( ) ;
         standaloneModal( ) ;
      }

      protected void btn_first( )
      {
         nKeyPressed = 2;
         IsConfirmed = 0;
         ScanStart011( ) ;
         if ( RcdFound1 == 0 )
         {
            GX_msglist.addItem(context.GetMessage( "GXM_norectobrow", ""), 0, "");
         }
         else
         {
            Gx_mode = "UPD";
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
         }
         GX_FocusControl = edtPedidoCantidadPersonas_Internalname;
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
         ScanEnd011( ) ;
         getByPrimaryKey( ) ;
         standaloneNotModal( ) ;
         standaloneModal( ) ;
      }

      protected void btn_previous( )
      {
         nKeyPressed = 2;
         IsConfirmed = 0;
         move_previous( ) ;
         if ( RcdFound1 == 0 )
         {
            GX_msglist.addItem(context.GetMessage( "GXM_norectobrow", ""), 0, "");
         }
         else
         {
            Gx_mode = "UPD";
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
         }
         GX_FocusControl = edtPedidoCantidadPersonas_Internalname;
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
         getByPrimaryKey( ) ;
         standaloneNotModal( ) ;
         standaloneModal( ) ;
      }

      protected void btn_next( )
      {
         nKeyPressed = 2;
         IsConfirmed = 0;
         move_next( ) ;
         if ( RcdFound1 == 0 )
         {
            GX_msglist.addItem(context.GetMessage( "GXM_norectobrow", ""), 0, "");
         }
         else
         {
            Gx_mode = "UPD";
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
         }
         GX_FocusControl = edtPedidoCantidadPersonas_Internalname;
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
         getByPrimaryKey( ) ;
         standaloneNotModal( ) ;
         standaloneModal( ) ;
      }

      protected void btn_last( )
      {
         nKeyPressed = 2;
         IsConfirmed = 0;
         ScanStart011( ) ;
         if ( RcdFound1 == 0 )
         {
            GX_msglist.addItem(context.GetMessage( "GXM_norectobrow", ""), 0, "");
         }
         else
         {
            while ( RcdFound1 != 0 )
            {
               ScanNext011( ) ;
            }
            Gx_mode = "UPD";
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
         }
         GX_FocusControl = edtPedidoCantidadPersonas_Internalname;
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
         ScanEnd011( ) ;
         getByPrimaryKey( ) ;
         standaloneNotModal( ) ;
         standaloneModal( ) ;
      }

      protected void btn_select( )
      {
         getEqualNoModal( ) ;
      }

      protected void CheckOptimisticConcurrency011( )
      {
         if ( StringUtil.StrCmp(Gx_mode, "INS") != 0 )
         {
            /* Using cursor T000126 */
            pr_default.execute(14, new Object[] {A1PedidoId});
            if ( (pr_default.getStatus(14) == 103) )
            {
               GX_msglist.addItem(context.GetMessage( "GXM_lock", new   object[]  {"Pedido"}), "RecordIsLocked", 1, "");
               AnyError = 1;
               return  ;
            }
            Gx_longc = false;
            if ( (pr_default.getStatus(14) == 101) || ( Z53PedidoCantidadPersonas != T000126_A53PedidoCantidadPersonas[0] ) || ( StringUtil.StrCmp(Z54PedidoEstado, T000126_A54PedidoEstado[0]) != 0 ) || ( Z55PedidoFHFin != T000126_A55PedidoFHFin[0] ) || ( Z56PedidoFHInicio != T000126_A56PedidoFHInicio[0] ) || ( StringUtil.StrCmp(Z57PedidoTipo, T000126_A57PedidoTipo[0]) != 0 ) )
            {
               Gx_longc = true;
            }
            if ( Gx_longc || ( Z6MesaId != T000126_A6MesaId[0] ) )
            {
               GX_msglist.addItem(context.GetMessage( "GXM_waschg", new   object[]  {"Pedido"}), "RecordWasChanged", 1, "");
               AnyError = 1;
               return  ;
            }
         }
      }

      protected void Insert011( )
      {
         BeforeValidate011( ) ;
         if ( AnyError == 0 )
         {
            CheckExtendedTable011( ) ;
         }
         if ( AnyError == 0 )
         {
            ZM011( 0) ;
            CheckOptimisticConcurrency011( ) ;
            if ( AnyError == 0 )
            {
               AfterConfirm011( ) ;
               if ( AnyError == 0 )
               {
                  BeforeInsert011( ) ;
                  if ( AnyError == 0 )
                  {
                     /* Using cursor T000127 */
                     pr_default.execute(15, new Object[] {A1PedidoId, A53PedidoCantidadPersonas, A54PedidoEstado, A55PedidoFHFin, A56PedidoFHInicio, A57PedidoTipo, A6MesaId});
                     pr_default.close(15);
                     dsDefault.SmartCacheProvider.SetUpdated("Pedido") ;
                     if ( (pr_default.getStatus(15) == 1) )
                     {
                        GX_msglist.addItem(context.GetMessage( "GXM_noupdate", ""), "DuplicatePrimaryKey", 1, "");
                        AnyError = 1;
                     }
                     if ( AnyError == 0 )
                     {
                        /* Start of After( Insert) rules */
                        /* End of After( Insert) rules */
                        if ( AnyError == 0 )
                        {
                           ProcessLevel011( ) ;
                           if ( AnyError == 0 )
                           {
                              /* Save values for previous() function. */
                              GX_msglist.addItem(context.GetMessage( "GXM_sucadded", ""), 0, "");
                              ResetCaption010( ) ;
                           }
                        }
                     }
                  }
                  else
                  {
                     GX_msglist.addItem(context.GetMessage( "GXM_unexp", ""), 1, "");
                     AnyError = 1;
                  }
               }
            }
            else
            {
               Load011( ) ;
            }
            EndLevel011( ) ;
         }
         CloseExtendedTableCursors011( ) ;
      }

      protected void Update011( )
      {
         BeforeValidate011( ) ;
         if ( AnyError == 0 )
         {
            CheckExtendedTable011( ) ;
         }
         if ( AnyError == 0 )
         {
            CheckOptimisticConcurrency011( ) ;
            if ( AnyError == 0 )
            {
               AfterConfirm011( ) ;
               if ( AnyError == 0 )
               {
                  BeforeUpdate011( ) ;
                  if ( AnyError == 0 )
                  {
                     /* Using cursor T000128 */
                     pr_default.execute(16, new Object[] {A53PedidoCantidadPersonas, A54PedidoEstado, A55PedidoFHFin, A56PedidoFHInicio, A57PedidoTipo, A6MesaId, A1PedidoId});
                     pr_default.close(16);
                     dsDefault.SmartCacheProvider.SetUpdated("Pedido") ;
                     if ( (pr_default.getStatus(16) == 103) )
                     {
                        GX_msglist.addItem(context.GetMessage( "GXM_lock", new   object[]  {"Pedido"}), "RecordIsLocked", 1, "");
                        AnyError = 1;
                     }
                     DeferredUpdate011( ) ;
                     if ( AnyError == 0 )
                     {
                        /* Start of After( update) rules */
                        /* End of After( update) rules */
                        if ( AnyError == 0 )
                        {
                           ProcessLevel011( ) ;
                           if ( AnyError == 0 )
                           {
                              getByPrimaryKey( ) ;
                              GX_msglist.addItem(context.GetMessage( "GXM_sucupdated", ""), 0, "");
                              ResetCaption010( ) ;
                           }
                        }
                     }
                     else
                     {
                        GX_msglist.addItem(context.GetMessage( "GXM_unexp", ""), 1, "");
                        AnyError = 1;
                     }
                  }
               }
            }
            EndLevel011( ) ;
         }
         CloseExtendedTableCursors011( ) ;
      }

      protected void DeferredUpdate011( )
      {
      }

      protected void delete( )
      {
         Gx_mode = "DLT";
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
         BeforeValidate011( ) ;
         if ( AnyError == 0 )
         {
            CheckOptimisticConcurrency011( ) ;
         }
         if ( AnyError == 0 )
         {
            OnDeleteControls011( ) ;
            AfterConfirm011( ) ;
            if ( AnyError == 0 )
            {
               BeforeDelete011( ) ;
               if ( AnyError == 0 )
               {
                  A8ImporteTotal = O8ImporteTotal;
                  n8ImporteTotal = false;
                  context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A8ImporteTotal", StringUtil.LTrim( StringUtil.Str( A8ImporteTotal, 5, 2)));
                  ScanStart012( ) ;
                  while ( RcdFound2 != 0 )
                  {
                     getByPrimaryKey012( ) ;
                     Delete012( ) ;
                     ScanNext012( ) ;
                     O8ImporteTotal = A8ImporteTotal;
                     n8ImporteTotal = false;
                     context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A8ImporteTotal", StringUtil.LTrim( StringUtil.Str( A8ImporteTotal, 5, 2)));
                  }
                  ScanEnd012( ) ;
                  if ( AnyError == 0 )
                  {
                     /* Using cursor T000129 */
                     pr_default.execute(17, new Object[] {A1PedidoId});
                     pr_default.close(17);
                     dsDefault.SmartCacheProvider.SetUpdated("Pedido") ;
                     if ( AnyError == 0 )
                     {
                        /* Start of After( delete) rules */
                        /* End of After( delete) rules */
                        if ( AnyError == 0 )
                        {
                           move_next( ) ;
                           if ( RcdFound1 == 0 )
                           {
                              InitAll011( ) ;
                              Gx_mode = "INS";
                              context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
                           }
                           else
                           {
                              getByPrimaryKey( ) ;
                              Gx_mode = "UPD";
                              context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
                           }
                           GX_msglist.addItem(context.GetMessage( "GXM_sucdeleted", ""), 0, "");
                           ResetCaption010( ) ;
                        }
                     }
                     else
                     {
                        GX_msglist.addItem(context.GetMessage( "GXM_unexp", ""), 1, "");
                        AnyError = 1;
                     }
                  }
               }
            }
         }
         sMode1 = Gx_mode;
         Gx_mode = "DLT";
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
         EndLevel011( ) ;
         Gx_mode = sMode1;
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
      }

      protected void OnDeleteControls011( )
      {
         standaloneModal( ) ;
         if ( AnyError == 0 )
         {
            /* Delete mode formulas */
            /* Using cursor T000133 */
            pr_default.execute(18, new Object[] {A1PedidoId});
            if ( (pr_default.getStatus(18) != 101) )
            {
               A8ImporteTotal = T000133_A8ImporteTotal[0];
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A8ImporteTotal", StringUtil.LTrim( StringUtil.Str( A8ImporteTotal, 5, 2)));
               n8ImporteTotal = T000133_n8ImporteTotal[0];
            }
            else
            {
               A8ImporteTotal = 0;
               n8ImporteTotal = false;
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A8ImporteTotal", StringUtil.LTrim( StringUtil.Str( A8ImporteTotal, 5, 2)));
            }
            pr_default.close(18);
         }
      }

      protected void ProcessNestedLevel012( )
      {
         s8ImporteTotal = O8ImporteTotal;
         n8ImporteTotal = false;
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A8ImporteTotal", StringUtil.LTrim( StringUtil.Str( A8ImporteTotal, 5, 2)));
         nGXsfl_76_idx = 0;
         while ( nGXsfl_76_idx < nRC_Gridpedido_linea )
         {
            ReadRow012( ) ;
            if ( ( nRcdExists_2 != 0 ) || ( nIsMod_2 != 0 ) )
            {
               standaloneNotModal012( ) ;
               GetKey012( ) ;
               if ( ( nRcdExists_2 == 0 ) && ( nRcdDeleted_2 == 0 ) )
               {
                  Gx_mode = "INS";
                  context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
                  Insert012( ) ;
               }
               else
               {
                  if ( RcdFound2 != 0 )
                  {
                     if ( ( nRcdDeleted_2 != 0 ) && ( nRcdExists_2 != 0 ) )
                     {
                        Gx_mode = "DLT";
                        context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
                        Delete012( ) ;
                     }
                     else
                     {
                        if ( ( nIsMod_2 != 0 ) && ( nRcdExists_2 != 0 ) )
                        {
                           Gx_mode = "UPD";
                           context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
                           Update012( ) ;
                        }
                     }
                  }
                  else
                  {
                     if ( nRcdDeleted_2 == 0 )
                     {
                        GX_msglist.addItem(context.GetMessage( "GXM_recdeleted", ""), 1, "PEDIDOLINEAID");
                        AnyError = 1;
                        GX_FocusControl = edtPedidoLineaId_Internalname;
                        context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
                     }
                  }
               }
               O8ImporteTotal = A8ImporteTotal;
               n8ImporteTotal = false;
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A8ImporteTotal", StringUtil.LTrim( StringUtil.Str( A8ImporteTotal, 5, 2)));
            }
            ChangePostValue( edtPedidoLineaId_Internalname, StringUtil.LTrim( StringUtil.NToC( (decimal)(A9PedidoLineaId), 10, 0, ",", ""))) ;
            ChangePostValue( edtPedidoLineaCantidad_Internalname, StringUtil.LTrim( StringUtil.NToC( (decimal)(A45PedidoLineaCantidad), 3, 0, ",", ""))) ;
            ChangePostValue( edtPedidoLineaComentarios_Internalname, StringUtil.RTrim( A46PedidoLineaComentarios)) ;
            ChangePostValue( edtPedidoLineaEstado_Internalname, StringUtil.RTrim( A47PedidoLineaEstado)) ;
            ChangePostValue( edtPedidoLineaFHInicio_Internalname, context.localUtil.Format(A48PedidoLineaFHInicio, "99/99/99 99:99")) ;
            ChangePostValue( edtPedidoLineaFHFin_Internalname, context.localUtil.Format(A49PedidoLineaFHFin, "99/99/99 99:99")) ;
            ChangePostValue( edtPedidoLineaPrioridad_Internalname, StringUtil.LTrim( StringUtil.NToC( (decimal)(A50PedidoLineaPrioridad), 4, 0, ",", ""))) ;
            ChangePostValue( edtProductoId_Internalname, StringUtil.LTrim( StringUtil.NToC( (decimal)(A16ProductoId), 10, 0, ",", ""))) ;
            ChangePostValue( edtProductoPrecio_Internalname, StringUtil.LTrim( StringUtil.NToC( A22ProductoPrecio, 5, 2, ",", ""))) ;
            ChangePostValue( edtLineaImporte_Internalname, StringUtil.LTrim( StringUtil.NToC( A17LineaImporte, 5, 2, ",", ""))) ;
            ChangePostValue( "ZT_"+"Z9PedidoLineaId_"+sGXsfl_76_idx, StringUtil.LTrim( StringUtil.NToC( (decimal)(Z9PedidoLineaId), 10, 0, ",", ""))) ;
            ChangePostValue( "ZT_"+"Z45PedidoLineaCantidad_"+sGXsfl_76_idx, StringUtil.LTrim( StringUtil.NToC( (decimal)(Z45PedidoLineaCantidad), 3, 0, ",", ""))) ;
            ChangePostValue( "ZT_"+"Z46PedidoLineaComentarios_"+sGXsfl_76_idx, StringUtil.RTrim( Z46PedidoLineaComentarios)) ;
            ChangePostValue( "ZT_"+"Z47PedidoLineaEstado_"+sGXsfl_76_idx, StringUtil.RTrim( Z47PedidoLineaEstado)) ;
            ChangePostValue( "ZT_"+"Z48PedidoLineaFHInicio_"+sGXsfl_76_idx, context.localUtil.TToC( Z48PedidoLineaFHInicio, 10, 8, 0, 0, "/", ":", " ")) ;
            ChangePostValue( "ZT_"+"Z49PedidoLineaFHFin_"+sGXsfl_76_idx, context.localUtil.TToC( Z49PedidoLineaFHFin, 10, 8, 0, 0, "/", ":", " ")) ;
            ChangePostValue( "ZT_"+"Z50PedidoLineaPrioridad_"+sGXsfl_76_idx, StringUtil.LTrim( StringUtil.NToC( (decimal)(Z50PedidoLineaPrioridad), 4, 0, ",", ""))) ;
            ChangePostValue( "ZT_"+"Z16ProductoId_"+sGXsfl_76_idx, StringUtil.LTrim( StringUtil.NToC( (decimal)(Z16ProductoId), 10, 0, ",", ""))) ;
            ChangePostValue( "T17LineaImporte_"+sGXsfl_76_idx, StringUtil.LTrim( StringUtil.NToC( O17LineaImporte, 5, 2, ",", ""))) ;
            ChangePostValue( "nRcdDeleted_2_"+sGXsfl_76_idx, StringUtil.LTrim( StringUtil.NToC( (decimal)(nRcdDeleted_2), 4, 0, ",", ""))) ;
            ChangePostValue( "nRcdExists_2_"+sGXsfl_76_idx, StringUtil.LTrim( StringUtil.NToC( (decimal)(nRcdExists_2), 4, 0, ",", ""))) ;
            ChangePostValue( "nIsMod_2_"+sGXsfl_76_idx, StringUtil.LTrim( StringUtil.NToC( (decimal)(nIsMod_2), 4, 0, ",", ""))) ;
            if ( nIsMod_2 != 0 )
            {
               ChangePostValue( "PEDIDOLINEAID_"+sGXsfl_76_idx+"Enabled", StringUtil.LTrim( StringUtil.NToC( (decimal)(edtPedidoLineaId_Enabled), 5, 0, ".", ""))) ;
               ChangePostValue( "PEDIDOLINEACANTIDAD_"+sGXsfl_76_idx+"Enabled", StringUtil.LTrim( StringUtil.NToC( (decimal)(edtPedidoLineaCantidad_Enabled), 5, 0, ".", ""))) ;
               ChangePostValue( "PEDIDOLINEACOMENTARIOS_"+sGXsfl_76_idx+"Enabled", StringUtil.LTrim( StringUtil.NToC( (decimal)(edtPedidoLineaComentarios_Enabled), 5, 0, ".", ""))) ;
               ChangePostValue( "PEDIDOLINEAESTADO_"+sGXsfl_76_idx+"Enabled", StringUtil.LTrim( StringUtil.NToC( (decimal)(edtPedidoLineaEstado_Enabled), 5, 0, ".", ""))) ;
               ChangePostValue( "PEDIDOLINEAFHINICIO_"+sGXsfl_76_idx+"Enabled", StringUtil.LTrim( StringUtil.NToC( (decimal)(edtPedidoLineaFHInicio_Enabled), 5, 0, ".", ""))) ;
               ChangePostValue( "PEDIDOLINEAFHFIN_"+sGXsfl_76_idx+"Enabled", StringUtil.LTrim( StringUtil.NToC( (decimal)(edtPedidoLineaFHFin_Enabled), 5, 0, ".", ""))) ;
               ChangePostValue( "PEDIDOLINEAPRIORIDAD_"+sGXsfl_76_idx+"Enabled", StringUtil.LTrim( StringUtil.NToC( (decimal)(edtPedidoLineaPrioridad_Enabled), 5, 0, ".", ""))) ;
               ChangePostValue( "PRODUCTOID_"+sGXsfl_76_idx+"Enabled", StringUtil.LTrim( StringUtil.NToC( (decimal)(edtProductoId_Enabled), 5, 0, ".", ""))) ;
               ChangePostValue( "PRODUCTOPRECIO_"+sGXsfl_76_idx+"Enabled", StringUtil.LTrim( StringUtil.NToC( (decimal)(edtProductoPrecio_Enabled), 5, 0, ".", ""))) ;
               ChangePostValue( "LINEAIMPORTE_"+sGXsfl_76_idx+"Enabled", StringUtil.LTrim( StringUtil.NToC( (decimal)(edtLineaImporte_Enabled), 5, 0, ".", ""))) ;
            }
         }
         /* Start of After( level) rules */
         /* End of After( level) rules */
         InitAll012( ) ;
         if ( AnyError != 0 )
         {
            O8ImporteTotal = s8ImporteTotal;
            n8ImporteTotal = false;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A8ImporteTotal", StringUtil.LTrim( StringUtil.Str( A8ImporteTotal, 5, 2)));
         }
         nRcdExists_2 = 0;
         nIsMod_2 = 0;
         nRcdDeleted_2 = 0;
      }

      protected void ProcessLevel011( )
      {
         /* Save parent mode. */
         sMode1 = Gx_mode;
         ProcessNestedLevel012( ) ;
         if ( AnyError != 0 )
         {
            O8ImporteTotal = s8ImporteTotal;
            n8ImporteTotal = false;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A8ImporteTotal", StringUtil.LTrim( StringUtil.Str( A8ImporteTotal, 5, 2)));
         }
         /* Restore parent mode. */
         Gx_mode = sMode1;
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
         /* ' Update level parameters */
      }

      protected void EndLevel011( )
      {
         if ( StringUtil.StrCmp(Gx_mode, "INS") != 0 )
         {
            pr_default.close(14);
         }
         if ( AnyError == 0 )
         {
            BeforeComplete011( ) ;
         }
         if ( AnyError == 0 )
         {
            pr_default.close(13);
            pr_default.close(12);
            pr_default.close(1);
            pr_default.close(0);
            pr_default.close(18);
            pr_default.close(2);
            pr_default.close(3);
            context.CommitDataStores("Pedido");
            if ( AnyError == 0 )
            {
               ConfirmValues010( ) ;
            }
            /* After transaction rules */
            /* Execute 'After Trn' event if defined. */
            trnEnded = 1;
         }
         else
         {
            pr_default.close(13);
            pr_default.close(12);
            pr_default.close(1);
            pr_default.close(0);
            pr_default.close(18);
            pr_default.close(2);
            pr_default.close(3);
            context.RollbackDataStores("Pedido");
         }
         IsModified = 0;
         if ( AnyError != 0 )
         {
            context.wjLoc = "";
            context.nUserReturn = 0;
         }
      }

      public void ScanStart011( )
      {
         /* Using cursor T000134 */
         pr_default.execute(19);
         RcdFound1 = 0;
         if ( (pr_default.getStatus(19) != 101) )
         {
            RcdFound1 = 1;
            A1PedidoId = T000134_A1PedidoId[0];
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A1PedidoId", StringUtil.LTrim( StringUtil.Str( (decimal)(A1PedidoId), 10, 0)));
         }
         /* Load Subordinate Levels */
      }

      protected void ScanNext011( )
      {
         /* Scan next routine */
         pr_default.readNext(19);
         RcdFound1 = 0;
         if ( (pr_default.getStatus(19) != 101) )
         {
            RcdFound1 = 1;
            A1PedidoId = T000134_A1PedidoId[0];
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A1PedidoId", StringUtil.LTrim( StringUtil.Str( (decimal)(A1PedidoId), 10, 0)));
         }
      }

      protected void ScanEnd011( )
      {
      }

      protected void AfterConfirm011( )
      {
         /* After Confirm Rules */
      }

      protected void BeforeInsert011( )
      {
         /* Before Insert Rules */
      }

      protected void BeforeUpdate011( )
      {
         /* Before Update Rules */
      }

      protected void BeforeDelete011( )
      {
         /* Before Delete Rules */
      }

      protected void BeforeComplete011( )
      {
         /* Before Complete Rules */
      }

      protected void BeforeValidate011( )
      {
         /* Before Validate Rules */
      }

      protected void DisableAttributes011( )
      {
         edtPedidoId_Enabled = 0;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, edtPedidoId_Internalname, "Enabled", StringUtil.LTrim( StringUtil.Str( (decimal)(edtPedidoId_Enabled), 5, 0)));
         edtPedidoCantidadPersonas_Enabled = 0;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, edtPedidoCantidadPersonas_Internalname, "Enabled", StringUtil.LTrim( StringUtil.Str( (decimal)(edtPedidoCantidadPersonas_Enabled), 5, 0)));
         edtPedidoEstado_Enabled = 0;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, edtPedidoEstado_Internalname, "Enabled", StringUtil.LTrim( StringUtil.Str( (decimal)(edtPedidoEstado_Enabled), 5, 0)));
         edtPedidoFHFin_Enabled = 0;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, edtPedidoFHFin_Internalname, "Enabled", StringUtil.LTrim( StringUtil.Str( (decimal)(edtPedidoFHFin_Enabled), 5, 0)));
         edtPedidoFHInicio_Enabled = 0;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, edtPedidoFHInicio_Internalname, "Enabled", StringUtil.LTrim( StringUtil.Str( (decimal)(edtPedidoFHInicio_Enabled), 5, 0)));
         edtMesaId_Enabled = 0;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, edtMesaId_Internalname, "Enabled", StringUtil.LTrim( StringUtil.Str( (decimal)(edtMesaId_Enabled), 5, 0)));
         edtPedidoTipo_Enabled = 0;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, edtPedidoTipo_Internalname, "Enabled", StringUtil.LTrim( StringUtil.Str( (decimal)(edtPedidoTipo_Enabled), 5, 0)));
         edtImporteTotal_Enabled = 0;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, edtImporteTotal_Internalname, "Enabled", StringUtil.LTrim( StringUtil.Str( (decimal)(edtImporteTotal_Enabled), 5, 0)));
      }

      protected void ZM012( short GX_JID )
      {
         if ( ( GX_JID == 10 ) || ( GX_JID == 0 ) )
         {
            if ( StringUtil.StrCmp(Gx_mode, "INS") != 0 )
            {
               Z45PedidoLineaCantidad = T00013_A45PedidoLineaCantidad[0];
               Z46PedidoLineaComentarios = T00013_A46PedidoLineaComentarios[0];
               Z47PedidoLineaEstado = T00013_A47PedidoLineaEstado[0];
               Z48PedidoLineaFHInicio = T00013_A48PedidoLineaFHInicio[0];
               Z49PedidoLineaFHFin = T00013_A49PedidoLineaFHFin[0];
               Z50PedidoLineaPrioridad = T00013_A50PedidoLineaPrioridad[0];
               Z16ProductoId = T00013_A16ProductoId[0];
            }
            else
            {
               Z45PedidoLineaCantidad = A45PedidoLineaCantidad;
               Z46PedidoLineaComentarios = A46PedidoLineaComentarios;
               Z47PedidoLineaEstado = A47PedidoLineaEstado;
               Z48PedidoLineaFHInicio = A48PedidoLineaFHInicio;
               Z49PedidoLineaFHFin = A49PedidoLineaFHFin;
               Z50PedidoLineaPrioridad = A50PedidoLineaPrioridad;
               Z16ProductoId = A16ProductoId;
            }
         }
         if ( GX_JID == -10 )
         {
            Z1PedidoId = A1PedidoId;
            Z9PedidoLineaId = A9PedidoLineaId;
            Z45PedidoLineaCantidad = A45PedidoLineaCantidad;
            Z46PedidoLineaComentarios = A46PedidoLineaComentarios;
            Z47PedidoLineaEstado = A47PedidoLineaEstado;
            Z48PedidoLineaFHInicio = A48PedidoLineaFHInicio;
            Z49PedidoLineaFHFin = A49PedidoLineaFHFin;
            Z50PedidoLineaPrioridad = A50PedidoLineaPrioridad;
            Z16ProductoId = A16ProductoId;
            Z22ProductoPrecio = A22ProductoPrecio;
         }
      }

      protected void standaloneNotModal012( )
      {
      }

      protected void standaloneModal012( )
      {
         if ( StringUtil.StrCmp(Gx_mode, "INS") != 0 )
         {
            edtPedidoLineaId_Enabled = 0;
         }
         else
         {
            edtPedidoLineaId_Enabled = 1;
         }
      }

      protected void Load012( )
      {
         /* Using cursor T000136 */
         pr_default.execute(20, new Object[] {A1PedidoId, A9PedidoLineaId});
         if ( (pr_default.getStatus(20) != 101) )
         {
            RcdFound2 = 1;
            A45PedidoLineaCantidad = T000136_A45PedidoLineaCantidad[0];
            A46PedidoLineaComentarios = T000136_A46PedidoLineaComentarios[0];
            A47PedidoLineaEstado = T000136_A47PedidoLineaEstado[0];
            A48PedidoLineaFHInicio = T000136_A48PedidoLineaFHInicio[0];
            A49PedidoLineaFHFin = T000136_A49PedidoLineaFHFin[0];
            A50PedidoLineaPrioridad = T000136_A50PedidoLineaPrioridad[0];
            A16ProductoId = T000136_A16ProductoId[0];
            n16ProductoId = T000136_n16ProductoId[0];
            A22ProductoPrecio = T000136_A22ProductoPrecio[0];
            n22ProductoPrecio = T000136_n22ProductoPrecio[0];
            ZM012( -10) ;
         }
         pr_default.close(20);
         OnLoadActions012( ) ;
      }

      protected void OnLoadActions012( )
      {
         A17LineaImporte = (decimal)(A45PedidoLineaCantidad*A22ProductoPrecio);
         n17LineaImporte = false;
         O17LineaImporte = A17LineaImporte;
         n17LineaImporte = false;
         if ( ( StringUtil.StrCmp(Gx_mode, "INS") == 0 )  )
         {
            A8ImporteTotal = (decimal)(O8ImporteTotal+A17LineaImporte);
            n8ImporteTotal = false;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A8ImporteTotal", StringUtil.LTrim( StringUtil.Str( A8ImporteTotal, 5, 2)));
         }
         else
         {
            if ( ( StringUtil.StrCmp(Gx_mode, "UPD") == 0 )  )
            {
               A8ImporteTotal = (decimal)(O8ImporteTotal+A17LineaImporte-O17LineaImporte);
               n8ImporteTotal = false;
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A8ImporteTotal", StringUtil.LTrim( StringUtil.Str( A8ImporteTotal, 5, 2)));
            }
            else
            {
               if ( ( StringUtil.StrCmp(Gx_mode, "DLT") == 0 )  )
               {
                  A8ImporteTotal = (decimal)(O8ImporteTotal-O17LineaImporte);
                  n8ImporteTotal = false;
                  context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A8ImporteTotal", StringUtil.LTrim( StringUtil.Str( A8ImporteTotal, 5, 2)));
               }
            }
         }
      }

      protected void CheckExtendedTable012( )
      {
         Gx_BScreen = 1;
         standaloneModal012( ) ;
         if ( ! ( (DateTime.MinValue==A48PedidoLineaFHInicio) || ( A48PedidoLineaFHInicio >= context.localUtil.YMDHMSToT( 1753, 1, 1, 0, 0, 0) ) ) )
         {
            GX_msglist.addItem("Campo Pedido Linea FHInicio fuera de rango", "OutOfRange", 1, "PEDIDOLINEAFHINICIO");
            AnyError = 1;
            GX_FocusControl = edtPedidoLineaFHInicio_Internalname;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
         }
         if ( ! ( (DateTime.MinValue==A49PedidoLineaFHFin) || ( A49PedidoLineaFHFin >= context.localUtil.YMDHMSToT( 1753, 1, 1, 0, 0, 0) ) ) )
         {
            GX_msglist.addItem("Campo Pedido Linea FHFin fuera de rango", "OutOfRange", 1, "PEDIDOLINEAFHFIN");
            AnyError = 1;
            GX_FocusControl = edtPedidoLineaFHFin_Internalname;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
         }
         /* Using cursor T00014 */
         pr_default.execute(2, new Object[] {n16ProductoId, A16ProductoId});
         if ( (pr_default.getStatus(2) == 101) )
         {
            GX_msglist.addItem("No existe 'Producto'.", "ForeignKeyNotFound", 1, "PRODUCTOID");
            AnyError = 1;
            GX_FocusControl = edtProductoId_Internalname;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
         }
         pr_default.close(2);
         /* Using cursor T00016 */
         pr_default.execute(3, new Object[] {n16ProductoId, A16ProductoId});
         if ( (pr_default.getStatus(3) != 101) )
         {
            A22ProductoPrecio = T00016_A22ProductoPrecio[0];
            n22ProductoPrecio = T00016_n22ProductoPrecio[0];
            A22ProductoPrecio = T00016_A22ProductoPrecio[0];
            n22ProductoPrecio = T00016_n22ProductoPrecio[0];
         }
         else
         {
            A22ProductoPrecio = 0;
            n22ProductoPrecio = false;
         }
         pr_default.close(3);
         A17LineaImporte = (decimal)(A45PedidoLineaCantidad*A22ProductoPrecio);
         n17LineaImporte = false;
         if ( ( StringUtil.StrCmp(Gx_mode, "INS") == 0 )  )
         {
            A8ImporteTotal = (decimal)(O8ImporteTotal+A17LineaImporte);
            n8ImporteTotal = false;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A8ImporteTotal", StringUtil.LTrim( StringUtil.Str( A8ImporteTotal, 5, 2)));
         }
         else
         {
            if ( ( StringUtil.StrCmp(Gx_mode, "UPD") == 0 )  )
            {
               A8ImporteTotal = (decimal)(O8ImporteTotal+A17LineaImporte-O17LineaImporte);
               n8ImporteTotal = false;
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A8ImporteTotal", StringUtil.LTrim( StringUtil.Str( A8ImporteTotal, 5, 2)));
            }
            else
            {
               if ( ( StringUtil.StrCmp(Gx_mode, "DLT") == 0 )  )
               {
                  A8ImporteTotal = (decimal)(O8ImporteTotal-O17LineaImporte);
                  n8ImporteTotal = false;
                  context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A8ImporteTotal", StringUtil.LTrim( StringUtil.Str( A8ImporteTotal, 5, 2)));
               }
            }
         }
      }

      protected void CloseExtendedTableCursors012( )
      {
         pr_default.close(2);
         pr_default.close(3);
      }

      protected void enableDisable012( )
      {
      }

      protected void gxLoad_11( long A16ProductoId )
      {
         /* Using cursor T000137 */
         pr_default.execute(21, new Object[] {n16ProductoId, A16ProductoId});
         if ( (pr_default.getStatus(21) == 101) )
         {
            GX_msglist.addItem("No existe 'Producto'.", "ForeignKeyNotFound", 1, "PRODUCTOID");
            AnyError = 1;
            GX_FocusControl = edtProductoId_Internalname;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
         }
         GxWebStd.set_html_headers( context, 0, "", "");
         context.GX_webresponse.AddString("new Array( new Array(");
         context.GX_webresponse.AddString("");
         context.GX_webresponse.AddString(")");
         if ( (pr_default.getStatus(21) == 101) )
         {
            context.GX_webresponse.AddString(",");
            context.GX_webresponse.AddString("101");
         }
         context.GX_webresponse.AddString(")");
         pr_default.close(21);
      }

      protected void gxLoad_12( long A16ProductoId )
      {
         /* Using cursor T000139 */
         pr_default.execute(22, new Object[] {n16ProductoId, A16ProductoId});
         if ( (pr_default.getStatus(22) != 101) )
         {
            A22ProductoPrecio = T000139_A22ProductoPrecio[0];
            n22ProductoPrecio = T000139_n22ProductoPrecio[0];
            A22ProductoPrecio = T000139_A22ProductoPrecio[0];
            n22ProductoPrecio = T000139_n22ProductoPrecio[0];
         }
         else
         {
            A22ProductoPrecio = 0;
            n22ProductoPrecio = false;
         }
         GxWebStd.set_html_headers( context, 0, "", "");
         context.GX_webresponse.AddString("new Array( new Array(");
         context.GX_webresponse.AddString("\""+GXUtil.EncodeJSConstant( StringUtil.LTrim( StringUtil.NToC( A22ProductoPrecio, 5, 2, ".", "")))+"\""+","+"\""+GXUtil.EncodeJSConstant( StringUtil.LTrim( StringUtil.NToC( A22ProductoPrecio, 5, 2, ".", "")))+"\"");
         context.GX_webresponse.AddString(")");
         if ( (pr_default.getStatus(22) == 101) )
         {
            context.GX_webresponse.AddString(",");
            context.GX_webresponse.AddString("101");
         }
         context.GX_webresponse.AddString(")");
         pr_default.close(22);
      }

      protected void GetKey012( )
      {
         /* Using cursor T000140 */
         pr_default.execute(23, new Object[] {A1PedidoId, A9PedidoLineaId});
         if ( (pr_default.getStatus(23) != 101) )
         {
            RcdFound2 = 1;
         }
         else
         {
            RcdFound2 = 0;
         }
         pr_default.close(23);
      }

      protected void getByPrimaryKey012( )
      {
         /* Using cursor T00013 */
         pr_default.execute(1, new Object[] {A1PedidoId, A9PedidoLineaId});
         if ( (pr_default.getStatus(1) != 101) )
         {
            ZM012( 10) ;
            RcdFound2 = 1;
            InitializeNonKey012( ) ;
            A9PedidoLineaId = T00013_A9PedidoLineaId[0];
            A45PedidoLineaCantidad = T00013_A45PedidoLineaCantidad[0];
            A46PedidoLineaComentarios = T00013_A46PedidoLineaComentarios[0];
            A47PedidoLineaEstado = T00013_A47PedidoLineaEstado[0];
            A48PedidoLineaFHInicio = T00013_A48PedidoLineaFHInicio[0];
            A49PedidoLineaFHFin = T00013_A49PedidoLineaFHFin[0];
            A50PedidoLineaPrioridad = T00013_A50PedidoLineaPrioridad[0];
            A16ProductoId = T00013_A16ProductoId[0];
            n16ProductoId = T00013_n16ProductoId[0];
            Z1PedidoId = A1PedidoId;
            Z9PedidoLineaId = A9PedidoLineaId;
            sMode2 = Gx_mode;
            Gx_mode = "DSP";
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
            standaloneModal012( ) ;
            Load012( ) ;
            Gx_mode = sMode2;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
         }
         else
         {
            RcdFound2 = 0;
            InitializeNonKey012( ) ;
            sMode2 = Gx_mode;
            Gx_mode = "DSP";
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
            standaloneModal012( ) ;
            Gx_mode = sMode2;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
         }
         if ( ( StringUtil.StrCmp(Gx_mode, "DSP") == 0 ) || ( StringUtil.StrCmp(Gx_mode, "DLT") == 0 ) )
         {
            DisableAttributes012( ) ;
         }
         pr_default.close(1);
      }

      protected void CheckOptimisticConcurrency012( )
      {
         if ( StringUtil.StrCmp(Gx_mode, "INS") != 0 )
         {
            /* Using cursor T00012 */
            pr_default.execute(0, new Object[] {A1PedidoId, A9PedidoLineaId});
            if ( (pr_default.getStatus(0) == 103) )
            {
               GX_msglist.addItem(context.GetMessage( "GXM_lock", new   object[]  {"PedidoLinea"}), "RecordIsLocked", 1, "");
               AnyError = 1;
               return  ;
            }
            Gx_longc = false;
            if ( (pr_default.getStatus(0) == 101) || ( Z45PedidoLineaCantidad != T00012_A45PedidoLineaCantidad[0] ) || ( StringUtil.StrCmp(Z46PedidoLineaComentarios, T00012_A46PedidoLineaComentarios[0]) != 0 ) || ( StringUtil.StrCmp(Z47PedidoLineaEstado, T00012_A47PedidoLineaEstado[0]) != 0 ) || ( Z48PedidoLineaFHInicio != T00012_A48PedidoLineaFHInicio[0] ) || ( Z49PedidoLineaFHFin != T00012_A49PedidoLineaFHFin[0] ) )
            {
               Gx_longc = true;
            }
            if ( Gx_longc || ( Z50PedidoLineaPrioridad != T00012_A50PedidoLineaPrioridad[0] ) || ( Z16ProductoId != T00012_A16ProductoId[0] ) )
            {
               GX_msglist.addItem(context.GetMessage( "GXM_waschg", new   object[]  {"PedidoLinea"}), "RecordWasChanged", 1, "");
               AnyError = 1;
               return  ;
            }
         }
      }

      protected void Insert012( )
      {
         BeforeValidate012( ) ;
         if ( AnyError == 0 )
         {
            CheckExtendedTable012( ) ;
         }
         if ( AnyError == 0 )
         {
            ZM012( 0) ;
            CheckOptimisticConcurrency012( ) ;
            if ( AnyError == 0 )
            {
               AfterConfirm012( ) ;
               if ( AnyError == 0 )
               {
                  BeforeInsert012( ) ;
                  if ( AnyError == 0 )
                  {
                     /* Using cursor T000141 */
                     pr_default.execute(24, new Object[] {A1PedidoId, A9PedidoLineaId, A45PedidoLineaCantidad, A46PedidoLineaComentarios, A47PedidoLineaEstado, A48PedidoLineaFHInicio, A49PedidoLineaFHFin, A50PedidoLineaPrioridad, n16ProductoId, A16ProductoId});
                     pr_default.close(24);
                     dsDefault.SmartCacheProvider.SetUpdated("PedidoLinea") ;
                     if ( (pr_default.getStatus(24) == 1) )
                     {
                        GX_msglist.addItem(context.GetMessage( "GXM_noupdate", ""), "DuplicatePrimaryKey", 1, "");
                        AnyError = 1;
                     }
                     if ( AnyError == 0 )
                     {
                        /* Start of After( Insert) rules */
                        /* End of After( Insert) rules */
                        if ( AnyError == 0 )
                        {
                           /* Save values for previous() function. */
                        }
                     }
                  }
                  else
                  {
                     GX_msglist.addItem(context.GetMessage( "GXM_unexp", ""), 1, "");
                     AnyError = 1;
                  }
               }
            }
            else
            {
               Load012( ) ;
            }
            EndLevel012( ) ;
         }
         CloseExtendedTableCursors012( ) ;
      }

      protected void Update012( )
      {
         BeforeValidate012( ) ;
         if ( AnyError == 0 )
         {
            CheckExtendedTable012( ) ;
         }
         if ( AnyError == 0 )
         {
            CheckOptimisticConcurrency012( ) ;
            if ( AnyError == 0 )
            {
               AfterConfirm012( ) ;
               if ( AnyError == 0 )
               {
                  BeforeUpdate012( ) ;
                  if ( AnyError == 0 )
                  {
                     /* Using cursor T000142 */
                     pr_default.execute(25, new Object[] {A45PedidoLineaCantidad, A46PedidoLineaComentarios, A47PedidoLineaEstado, A48PedidoLineaFHInicio, A49PedidoLineaFHFin, A50PedidoLineaPrioridad, n16ProductoId, A16ProductoId, A1PedidoId, A9PedidoLineaId});
                     pr_default.close(25);
                     dsDefault.SmartCacheProvider.SetUpdated("PedidoLinea") ;
                     if ( (pr_default.getStatus(25) == 103) )
                     {
                        GX_msglist.addItem(context.GetMessage( "GXM_lock", new   object[]  {"PedidoLinea"}), "RecordIsLocked", 1, "");
                        AnyError = 1;
                     }
                     DeferredUpdate012( ) ;
                     if ( AnyError == 0 )
                     {
                        /* Start of After( update) rules */
                        /* End of After( update) rules */
                        if ( AnyError == 0 )
                        {
                           getByPrimaryKey012( ) ;
                        }
                     }
                     else
                     {
                        GX_msglist.addItem(context.GetMessage( "GXM_unexp", ""), 1, "");
                        AnyError = 1;
                     }
                  }
               }
            }
            EndLevel012( ) ;
         }
         CloseExtendedTableCursors012( ) ;
      }

      protected void DeferredUpdate012( )
      {
      }

      protected void Delete012( )
      {
         Gx_mode = "DLT";
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
         BeforeValidate012( ) ;
         if ( AnyError == 0 )
         {
            CheckOptimisticConcurrency012( ) ;
         }
         if ( AnyError == 0 )
         {
            OnDeleteControls012( ) ;
            AfterConfirm012( ) ;
            if ( AnyError == 0 )
            {
               BeforeDelete012( ) ;
               if ( AnyError == 0 )
               {
                  /* No cascading delete specified. */
                  /* Using cursor T000143 */
                  pr_default.execute(26, new Object[] {A1PedidoId, A9PedidoLineaId});
                  pr_default.close(26);
                  dsDefault.SmartCacheProvider.SetUpdated("PedidoLinea") ;
                  if ( AnyError == 0 )
                  {
                     /* Start of After( delete) rules */
                     /* End of After( delete) rules */
                  }
                  else
                  {
                     GX_msglist.addItem(context.GetMessage( "GXM_unexp", ""), 1, "");
                     AnyError = 1;
                  }
               }
            }
         }
         sMode2 = Gx_mode;
         Gx_mode = "DLT";
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
         EndLevel012( ) ;
         Gx_mode = sMode2;
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
      }

      protected void OnDeleteControls012( )
      {
         standaloneModal012( ) ;
         if ( AnyError == 0 )
         {
            /* Delete mode formulas */
            /* Using cursor T000145 */
            pr_default.execute(27, new Object[] {n16ProductoId, A16ProductoId});
            if ( (pr_default.getStatus(27) != 101) )
            {
               A22ProductoPrecio = T000145_A22ProductoPrecio[0];
               n22ProductoPrecio = T000145_n22ProductoPrecio[0];
               A22ProductoPrecio = T000145_A22ProductoPrecio[0];
               n22ProductoPrecio = T000145_n22ProductoPrecio[0];
            }
            else
            {
               A22ProductoPrecio = 0;
               n22ProductoPrecio = false;
            }
            pr_default.close(27);
            A17LineaImporte = (decimal)(A45PedidoLineaCantidad*A22ProductoPrecio);
            n17LineaImporte = false;
            if ( ( StringUtil.StrCmp(Gx_mode, "INS") == 0 )  )
            {
               A8ImporteTotal = (decimal)(O8ImporteTotal+A17LineaImporte);
               n8ImporteTotal = false;
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A8ImporteTotal", StringUtil.LTrim( StringUtil.Str( A8ImporteTotal, 5, 2)));
            }
            else
            {
               if ( ( StringUtil.StrCmp(Gx_mode, "UPD") == 0 )  )
               {
                  A8ImporteTotal = (decimal)(O8ImporteTotal+A17LineaImporte-O17LineaImporte);
                  n8ImporteTotal = false;
                  context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A8ImporteTotal", StringUtil.LTrim( StringUtil.Str( A8ImporteTotal, 5, 2)));
               }
               else
               {
                  if ( ( StringUtil.StrCmp(Gx_mode, "DLT") == 0 )  )
                  {
                     A8ImporteTotal = (decimal)(O8ImporteTotal-O17LineaImporte);
                     n8ImporteTotal = false;
                     context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A8ImporteTotal", StringUtil.LTrim( StringUtil.Str( A8ImporteTotal, 5, 2)));
                  }
               }
            }
         }
      }

      protected void EndLevel012( )
      {
         if ( StringUtil.StrCmp(Gx_mode, "INS") != 0 )
         {
            pr_default.close(0);
         }
         if ( AnyError != 0 )
         {
            context.wjLoc = "";
            context.nUserReturn = 0;
         }
      }

      public void ScanStart012( )
      {
         /* Scan By routine */
         /* Using cursor T000146 */
         pr_default.execute(28, new Object[] {A1PedidoId});
         RcdFound2 = 0;
         if ( (pr_default.getStatus(28) != 101) )
         {
            RcdFound2 = 1;
            A9PedidoLineaId = T000146_A9PedidoLineaId[0];
         }
         /* Load Subordinate Levels */
      }

      protected void ScanNext012( )
      {
         /* Scan next routine */
         pr_default.readNext(28);
         RcdFound2 = 0;
         if ( (pr_default.getStatus(28) != 101) )
         {
            RcdFound2 = 1;
            A9PedidoLineaId = T000146_A9PedidoLineaId[0];
         }
      }

      protected void ScanEnd012( )
      {
         pr_default.close(1);
      }

      protected void AfterConfirm012( )
      {
         /* After Confirm Rules */
      }

      protected void BeforeInsert012( )
      {
         /* Before Insert Rules */
      }

      protected void BeforeUpdate012( )
      {
         /* Before Update Rules */
      }

      protected void BeforeDelete012( )
      {
         /* Before Delete Rules */
      }

      protected void BeforeComplete012( )
      {
         /* Before Complete Rules */
      }

      protected void BeforeValidate012( )
      {
         /* Before Validate Rules */
      }

      protected void DisableAttributes012( )
      {
         edtPedidoLineaId_Enabled = 0;
         edtPedidoLineaCantidad_Enabled = 0;
         edtPedidoLineaComentarios_Enabled = 0;
         edtPedidoLineaEstado_Enabled = 0;
         edtPedidoLineaFHInicio_Enabled = 0;
         edtPedidoLineaFHFin_Enabled = 0;
         edtPedidoLineaPrioridad_Enabled = 0;
         edtProductoId_Enabled = 0;
         edtProductoPrecio_Enabled = 0;
         edtLineaImporte_Enabled = 0;
      }

      protected void AddRow012( )
      {
         nGXsfl_76_idx = (short)(nGXsfl_76_idx+1);
         sGXsfl_76_idx = StringUtil.PadL( StringUtil.LTrim( StringUtil.Str( (decimal)(nGXsfl_76_idx), 4, 0)), 4, "0");
         edtPedidoLineaId_Internalname = "PEDIDOLINEAID_"+sGXsfl_76_idx;
         edtPedidoLineaCantidad_Internalname = "PEDIDOLINEACANTIDAD_"+sGXsfl_76_idx;
         edtPedidoLineaComentarios_Internalname = "PEDIDOLINEACOMENTARIOS_"+sGXsfl_76_idx;
         edtPedidoLineaEstado_Internalname = "PEDIDOLINEAESTADO_"+sGXsfl_76_idx;
         edtPedidoLineaFHInicio_Internalname = "PEDIDOLINEAFHINICIO_"+sGXsfl_76_idx;
         edtPedidoLineaFHFin_Internalname = "PEDIDOLINEAFHFIN_"+sGXsfl_76_idx;
         edtPedidoLineaPrioridad_Internalname = "PEDIDOLINEAPRIORIDAD_"+sGXsfl_76_idx;
         edtProductoId_Internalname = "PRODUCTOID_"+sGXsfl_76_idx;
         imgprompt_16_Internalname = "PROMPT_16_"+sGXsfl_76_idx;
         edtProductoPrecio_Internalname = "PRODUCTOPRECIO_"+sGXsfl_76_idx;
         edtLineaImporte_Internalname = "LINEAIMPORTE_"+sGXsfl_76_idx;
         SendRow012( ) ;
      }

      protected void SendRow012( )
      {
         Gridpedido_lineaRow = GXWebRow.GetNew(context);
         if ( subGridpedido_linea_Backcolorstyle == 0 )
         {
            /* None style subfile background logic. */
            subGridpedido_linea_Backstyle = 0;
            if ( StringUtil.StrCmp(subGridpedido_linea_Class, "") != 0 )
            {
               subGridpedido_linea_Linesclass = subGridpedido_linea_Class+"Odd";
            }
         }
         else if ( subGridpedido_linea_Backcolorstyle == 1 )
         {
            /* Uniform style subfile background logic. */
            subGridpedido_linea_Backstyle = 0;
            subGridpedido_linea_Backcolor = subGridpedido_linea_Allbackcolor;
            if ( StringUtil.StrCmp(subGridpedido_linea_Class, "") != 0 )
            {
               subGridpedido_linea_Linesclass = subGridpedido_linea_Class+"Uniform";
            }
         }
         else if ( subGridpedido_linea_Backcolorstyle == 2 )
         {
            /* Header style subfile background logic. */
            subGridpedido_linea_Backstyle = 1;
            if ( StringUtil.StrCmp(subGridpedido_linea_Class, "") != 0 )
            {
               subGridpedido_linea_Linesclass = subGridpedido_linea_Class+"Odd";
            }
            subGridpedido_linea_Backcolor = (int)(0xF0F0F0);
         }
         else if ( subGridpedido_linea_Backcolorstyle == 3 )
         {
            /* Report style subfile background logic. */
            subGridpedido_linea_Backstyle = 1;
            if ( (int)(nGXsfl_76_idx % (2)) == 0 )
            {
               subGridpedido_linea_Backcolor = (int)(0x0);
               if ( StringUtil.StrCmp(subGridpedido_linea_Class, "") != 0 )
               {
                  subGridpedido_linea_Linesclass = subGridpedido_linea_Class+"Even";
               }
            }
            else
            {
               subGridpedido_linea_Backcolor = (int)(0xF0F0F0);
               if ( StringUtil.StrCmp(subGridpedido_linea_Class, "") != 0 )
               {
                  subGridpedido_linea_Linesclass = subGridpedido_linea_Class+"Odd";
               }
            }
         }
         imgprompt_16_Link = ((StringUtil.StrCmp(Gx_mode, "DSP")==0) ? "" : "javascript:"+"gx.popup.openPrompt('"+"gx0040.aspx"+"',["+"{Ctrl:gx.dom.el('"+"PRODUCTOID_"+sGXsfl_76_idx+"'), id:'"+"PRODUCTOID_"+sGXsfl_76_idx+"'"+",IOType:'out'}"+"],"+"gx.dom.form()."+"nIsMod_2_"+sGXsfl_76_idx+","+"'', false"+","+"false"+");");
         /* * Property Link not supported in */
         /* * Property Link not supported in */
         /* Subfile cell */
         /* Single line edit */
         TempTags = " gxoch1=\"gx.fn.setControlValue('nIsMod_2_" + sGXsfl_76_idx + "',1);\"  onfocus=\"gx.evt.onfocus(this, 77,'',false,'" + sGXsfl_76_idx + "',76)\"";
         ClassString = "Attribute";
         StyleString = "";
         ROClassString = ClassString;
         Gridpedido_lineaRow.AddColumnProperties("edit", 1, isAjaxCallMode( ), new Object[] {(String)edtPedidoLineaId_Internalname,StringUtil.LTrim( StringUtil.NToC( (decimal)(A9PedidoLineaId), 10, 0, ",", "")),StringUtil.LTrim( context.localUtil.Format( (decimal)(A9PedidoLineaId), "ZZZZZZZZZ9")),TempTags+" onchange=\"gx.evt.onchange(this)\" "+" onblur=\""+"gx.num.valid_integer( this,'.');"+";gx.evt.onblur(77);\"",(String)"",(String)"",(String)"",(String)"",(String)"",(String)edtPedidoLineaId_Jsonclick,(short)0,(String)ClassString,(String)StyleString,(String)ROClassString,(short)-1,(int)edtPedidoLineaId_Enabled,(short)1,(String)"text",(String)"",(short)0,(String)"px",(short)17,(String)"px",(short)10,(short)0,(short)0,(short)76,(short)1,(short)-1,(short)0,(bool)true,(String)"Id",(String)"right"});
         /* Subfile cell */
         /* Single line edit */
         TempTags = " gxoch1=\"gx.fn.setControlValue('nIsMod_2_" + sGXsfl_76_idx + "',1);\"  onfocus=\"gx.evt.onfocus(this, 78,'',false,'" + sGXsfl_76_idx + "',76)\"";
         ClassString = "Attribute";
         StyleString = "";
         ROClassString = ClassString;
         Gridpedido_lineaRow.AddColumnProperties("edit", 1, isAjaxCallMode( ), new Object[] {(String)edtPedidoLineaCantidad_Internalname,StringUtil.LTrim( StringUtil.NToC( (decimal)(A45PedidoLineaCantidad), 3, 0, ",", "")),((edtPedidoLineaCantidad_Enabled!=0) ? StringUtil.LTrim( context.localUtil.Format( (decimal)(A45PedidoLineaCantidad), "ZZ9")) : context.localUtil.Format( (decimal)(A45PedidoLineaCantidad), "ZZ9")),TempTags+" onchange=\"gx.evt.onchange(this)\" "+" onblur=\""+"gx.num.valid_integer( this,'.');"+";gx.evt.onblur(78);\"",(String)"",(String)"",(String)"",(String)"",(String)"",(String)edtPedidoLineaCantidad_Jsonclick,(short)0,(String)ClassString,(String)StyleString,(String)ROClassString,(short)-1,(int)edtPedidoLineaCantidad_Enabled,(short)0,(String)"text",(String)"",(short)0,(String)"px",(short)17,(String)"px",(short)3,(short)0,(short)0,(short)76,(short)1,(short)-1,(short)0,(bool)true,(String)"Cantidad",(String)"right"});
         /* Subfile cell */
         /* Single line edit */
         TempTags = " gxoch1=\"gx.fn.setControlValue('nIsMod_2_" + sGXsfl_76_idx + "',1);\"  onfocus=\"gx.evt.onfocus(this, 79,'',false,'" + sGXsfl_76_idx + "',76)\"";
         ClassString = "Attribute";
         StyleString = "";
         ROClassString = ClassString;
         Gridpedido_lineaRow.AddColumnProperties("edit", 1, isAjaxCallMode( ), new Object[] {(String)edtPedidoLineaComentarios_Internalname,StringUtil.RTrim( A46PedidoLineaComentarios),(String)"",TempTags+" onchange=\"gx.evt.onchange(this)\" "+" onblur=\""+""+";gx.evt.onblur(79);\"",(String)"",(String)"",(String)"",(String)"",(String)"",(String)edtPedidoLineaComentarios_Jsonclick,(short)0,(String)ClassString,(String)StyleString,(String)ROClassString,(short)-1,(int)edtPedidoLineaComentarios_Enabled,(short)0,(String)"text",(String)"",(short)0,(String)"px",(short)17,(String)"px",(short)200,(short)0,(short)0,(short)76,(short)1,(short)-1,(short)-1,(bool)true,(String)"",(String)"left"});
         /* Subfile cell */
         /* Single line edit */
         TempTags = " gxoch1=\"gx.fn.setControlValue('nIsMod_2_" + sGXsfl_76_idx + "',1);\"  onfocus=\"gx.evt.onfocus(this, 80,'',false,'" + sGXsfl_76_idx + "',76)\"";
         ClassString = "Attribute";
         StyleString = "";
         ROClassString = ClassString;
         Gridpedido_lineaRow.AddColumnProperties("edit", 1, isAjaxCallMode( ), new Object[] {(String)edtPedidoLineaEstado_Internalname,StringUtil.RTrim( A47PedidoLineaEstado),(String)"",TempTags+" onchange=\"gx.evt.onchange(this)\" "+" onblur=\""+""+";gx.evt.onblur(80);\"",(String)"",(String)"",(String)"",(String)"",(String)"",(String)edtPedidoLineaEstado_Jsonclick,(short)0,(String)ClassString,(String)StyleString,(String)ROClassString,(short)-1,(int)edtPedidoLineaEstado_Enabled,(short)0,(String)"text",(String)"",(short)0,(String)"px",(short)17,(String)"px",(short)1,(short)0,(short)0,(short)76,(short)1,(short)-1,(short)-1,(bool)true,(String)"Estado",(String)"left"});
         /* Subfile cell */
         /* Single line edit */
         TempTags = " gxoch1=\"gx.fn.setControlValue('nIsMod_2_" + sGXsfl_76_idx + "',1);\"  onfocus=\"gx.evt.onfocus(this, 81,'',false,'" + sGXsfl_76_idx + "',76)\"";
         ClassString = "Attribute";
         StyleString = "";
         ROClassString = ClassString;
         Gridpedido_lineaRow.AddColumnProperties("edit", 1, isAjaxCallMode( ), new Object[] {(String)edtPedidoLineaFHInicio_Internalname,context.localUtil.Format(A48PedidoLineaFHInicio, "99/99/99 99:99"),context.localUtil.Format( A48PedidoLineaFHInicio, "99/99/99 99:99"),TempTags+" onchange=\"gx.evt.onchange(this)\" "+" onblur=\""+"gx.date.valid_date(this, 8,'DMY',5,24,'spa',false,0);"+";gx.evt.onblur(81);\"",(String)"",(String)"",(String)"",(String)"",(String)"",(String)edtPedidoLineaFHInicio_Jsonclick,(short)0,(String)ClassString,(String)StyleString,(String)ROClassString,(short)-1,(int)edtPedidoLineaFHInicio_Enabled,(short)0,(String)"text",(String)"",(short)0,(String)"px",(short)17,(String)"px",(short)14,(short)0,(short)0,(short)76,(short)1,(short)-1,(short)0,(bool)true,(String)"",(String)"right"});
         /* Subfile cell */
         /* Single line edit */
         TempTags = " gxoch1=\"gx.fn.setControlValue('nIsMod_2_" + sGXsfl_76_idx + "',1);\"  onfocus=\"gx.evt.onfocus(this, 82,'',false,'" + sGXsfl_76_idx + "',76)\"";
         ClassString = "Attribute";
         StyleString = "";
         ROClassString = ClassString;
         Gridpedido_lineaRow.AddColumnProperties("edit", 1, isAjaxCallMode( ), new Object[] {(String)edtPedidoLineaFHFin_Internalname,context.localUtil.Format(A49PedidoLineaFHFin, "99/99/99 99:99"),context.localUtil.Format( A49PedidoLineaFHFin, "99/99/99 99:99"),TempTags+" onchange=\"gx.evt.onchange(this)\" "+" onblur=\""+"gx.date.valid_date(this, 8,'DMY',5,24,'spa',false,0);"+";gx.evt.onblur(82);\"",(String)"",(String)"",(String)"",(String)"",(String)"",(String)edtPedidoLineaFHFin_Jsonclick,(short)0,(String)ClassString,(String)StyleString,(String)ROClassString,(short)-1,(int)edtPedidoLineaFHFin_Enabled,(short)0,(String)"text",(String)"",(short)0,(String)"px",(short)17,(String)"px",(short)14,(short)0,(short)0,(short)76,(short)1,(short)-1,(short)0,(bool)true,(String)"",(String)"right"});
         /* Subfile cell */
         /* Single line edit */
         TempTags = " gxoch1=\"gx.fn.setControlValue('nIsMod_2_" + sGXsfl_76_idx + "',1);\"  onfocus=\"gx.evt.onfocus(this, 83,'',false,'" + sGXsfl_76_idx + "',76)\"";
         ClassString = "Attribute";
         StyleString = "";
         ROClassString = ClassString;
         Gridpedido_lineaRow.AddColumnProperties("edit", 1, isAjaxCallMode( ), new Object[] {(String)edtPedidoLineaPrioridad_Internalname,StringUtil.LTrim( StringUtil.NToC( (decimal)(A50PedidoLineaPrioridad), 4, 0, ",", "")),((edtPedidoLineaPrioridad_Enabled!=0) ? StringUtil.LTrim( context.localUtil.Format( (decimal)(A50PedidoLineaPrioridad), "ZZZ9")) : context.localUtil.Format( (decimal)(A50PedidoLineaPrioridad), "ZZZ9")),TempTags+" onchange=\"gx.evt.onchange(this)\" "+" onblur=\""+"gx.num.valid_integer( this,'.');"+";gx.evt.onblur(83);\"",(String)"",(String)"",(String)"",(String)"",(String)"",(String)edtPedidoLineaPrioridad_Jsonclick,(short)0,(String)ClassString,(String)StyleString,(String)ROClassString,(short)-1,(int)edtPedidoLineaPrioridad_Enabled,(short)0,(String)"text",(String)"",(short)0,(String)"px",(short)17,(String)"px",(short)4,(short)0,(short)0,(short)76,(short)1,(short)-1,(short)0,(bool)true,(String)"",(String)"right"});
         /* Subfile cell */
         /* Single line edit */
         TempTags = " gxoch1=\"gx.fn.setControlValue('nIsMod_2_" + sGXsfl_76_idx + "',1);\"  onfocus=\"gx.evt.onfocus(this, 84,'',false,'" + sGXsfl_76_idx + "',76)\"";
         ClassString = "Attribute";
         StyleString = "";
         ROClassString = ClassString;
         Gridpedido_lineaRow.AddColumnProperties("edit", 1, isAjaxCallMode( ), new Object[] {(String)edtProductoId_Internalname,StringUtil.LTrim( StringUtil.NToC( (decimal)(A16ProductoId), 10, 0, ",", "")),((edtProductoId_Enabled!=0) ? StringUtil.LTrim( context.localUtil.Format( (decimal)(A16ProductoId), "ZZZZZZZZZ9")) : context.localUtil.Format( (decimal)(A16ProductoId), "ZZZZZZZZZ9")),TempTags+" onchange=\"gx.evt.onchange(this)\" "+" onblur=\""+"gx.num.valid_integer( this,'.');"+";gx.evt.onblur(84);\"",(String)"",(String)"",(String)"",(String)"",(String)"",(String)edtProductoId_Jsonclick,(short)0,(String)ClassString,(String)StyleString,(String)ROClassString,(short)-1,(int)edtProductoId_Enabled,(short)0,(String)"text",(String)"",(short)0,(String)"px",(short)17,(String)"px",(short)10,(short)0,(short)0,(short)76,(short)1,(short)-1,(short)0,(bool)true,(String)"Id",(String)"right"});
         /* Subfile cell */
         /* Static images/pictures */
         ClassString = "Image";
         StyleString = "";
         Gridpedido_lineaRow.AddColumnProperties("bitmap", 1, isAjaxCallMode( ), new Object[] {(String)imgprompt_16_Internalname,context.GetImagePath( "f5b04895-0024-488b-8e3b-b687ca4598ee", "", context.GetTheme( )),(String)imgprompt_16_Link,(String)"",(String)"",context.GetTheme( ),(int)imgprompt_16_Visible,(short)1,(String)"",(String)"",(short)0,(short)0,(short)0,(String)"",(short)0,(String)"",(short)0,(short)0,(short)0,(String)"",(String)"",(String)StyleString,(String)ClassString,(String)"",(String)"",(String)"",(String)"''",(String)"",(short)1,(bool)false,(bool)false});
         /* Subfile cell */
         /* Single line edit */
         ClassString = "Attribute";
         StyleString = "";
         ROClassString = ClassString;
         Gridpedido_lineaRow.AddColumnProperties("edit", 1, isAjaxCallMode( ), new Object[] {(String)edtProductoPrecio_Internalname,StringUtil.LTrim( StringUtil.NToC( A22ProductoPrecio, 5, 2, ",", "")),((edtProductoPrecio_Enabled!=0) ? StringUtil.LTrim( context.localUtil.Format( A22ProductoPrecio, "Z9.99")) : context.localUtil.Format( A22ProductoPrecio, "Z9.99")),(String)"",(String)"",(String)"",(String)"",(String)"",(String)"",(String)edtProductoPrecio_Jsonclick,(short)0,(String)ClassString,(String)StyleString,(String)ROClassString,(short)-1,(int)edtProductoPrecio_Enabled,(short)0,(String)"text",(String)"",(short)0,(String)"px",(short)17,(String)"px",(short)5,(short)0,(short)0,(short)76,(short)1,(short)-1,(short)0,(bool)true,(String)"Precio",(String)"right"});
         /* Subfile cell */
         /* Single line edit */
         ClassString = "Attribute";
         StyleString = "";
         ROClassString = ClassString;
         Gridpedido_lineaRow.AddColumnProperties("edit", 1, isAjaxCallMode( ), new Object[] {(String)edtLineaImporte_Internalname,StringUtil.LTrim( StringUtil.NToC( A17LineaImporte, 5, 2, ",", "")),((edtLineaImporte_Enabled!=0) ? StringUtil.LTrim( context.localUtil.Format( A17LineaImporte, "Z9.99")) : context.localUtil.Format( A17LineaImporte, "Z9.99")),(String)"",(String)"",(String)"",(String)"",(String)"",(String)"",(String)edtLineaImporte_Jsonclick,(short)0,(String)ClassString,(String)StyleString,(String)ROClassString,(short)-1,(int)edtLineaImporte_Enabled,(short)0,(String)"text",(String)"",(short)0,(String)"px",(short)17,(String)"px",(short)5,(short)0,(short)0,(short)76,(short)1,(short)-1,(short)0,(bool)true,(String)"Importe",(String)"right"});
         context.httpAjaxContext.ajax_sending_grid_row(Gridpedido_lineaRow);
         GXCCtl = "Z9PedidoLineaId_" + sGXsfl_76_idx;
         GxWebStd.gx_hidden_field( context, GXCCtl, StringUtil.LTrim( StringUtil.NToC( (decimal)(Z9PedidoLineaId), 10, 0, ",", "")));
         GXCCtl = "Z45PedidoLineaCantidad_" + sGXsfl_76_idx;
         GxWebStd.gx_hidden_field( context, GXCCtl, StringUtil.LTrim( StringUtil.NToC( (decimal)(Z45PedidoLineaCantidad), 3, 0, ",", "")));
         GXCCtl = "Z46PedidoLineaComentarios_" + sGXsfl_76_idx;
         GxWebStd.gx_hidden_field( context, GXCCtl, StringUtil.RTrim( Z46PedidoLineaComentarios));
         GXCCtl = "Z47PedidoLineaEstado_" + sGXsfl_76_idx;
         GxWebStd.gx_hidden_field( context, GXCCtl, StringUtil.RTrim( Z47PedidoLineaEstado));
         GXCCtl = "Z48PedidoLineaFHInicio_" + sGXsfl_76_idx;
         GxWebStd.gx_hidden_field( context, GXCCtl, context.localUtil.TToC( Z48PedidoLineaFHInicio, 10, 8, 0, 0, "/", ":", " "));
         GXCCtl = "Z49PedidoLineaFHFin_" + sGXsfl_76_idx;
         GxWebStd.gx_hidden_field( context, GXCCtl, context.localUtil.TToC( Z49PedidoLineaFHFin, 10, 8, 0, 0, "/", ":", " "));
         GXCCtl = "Z50PedidoLineaPrioridad_" + sGXsfl_76_idx;
         GxWebStd.gx_hidden_field( context, GXCCtl, StringUtil.LTrim( StringUtil.NToC( (decimal)(Z50PedidoLineaPrioridad), 4, 0, ",", "")));
         GXCCtl = "Z16ProductoId_" + sGXsfl_76_idx;
         GxWebStd.gx_hidden_field( context, GXCCtl, StringUtil.LTrim( StringUtil.NToC( (decimal)(Z16ProductoId), 10, 0, ",", "")));
         GXCCtl = "O17LineaImporte_" + sGXsfl_76_idx;
         GxWebStd.gx_hidden_field( context, GXCCtl, StringUtil.LTrim( StringUtil.NToC( O17LineaImporte, 5, 2, ",", "")));
         GXCCtl = "nRcdDeleted_2_" + sGXsfl_76_idx;
         GxWebStd.gx_hidden_field( context, GXCCtl, StringUtil.LTrim( StringUtil.NToC( (decimal)(nRcdDeleted_2), 4, 0, ",", "")));
         GXCCtl = "nRcdExists_2_" + sGXsfl_76_idx;
         GxWebStd.gx_hidden_field( context, GXCCtl, StringUtil.LTrim( StringUtil.NToC( (decimal)(nRcdExists_2), 4, 0, ",", "")));
         GXCCtl = "nIsMod_2_" + sGXsfl_76_idx;
         GxWebStd.gx_hidden_field( context, GXCCtl, StringUtil.LTrim( StringUtil.NToC( (decimal)(nIsMod_2), 4, 0, ",", "")));
         GxWebStd.gx_hidden_field( context, "PEDIDOLINEAID_"+sGXsfl_76_idx+"Enabled", StringUtil.LTrim( StringUtil.NToC( (decimal)(edtPedidoLineaId_Enabled), 5, 0, ".", "")));
         GxWebStd.gx_hidden_field( context, "PEDIDOLINEACANTIDAD_"+sGXsfl_76_idx+"Enabled", StringUtil.LTrim( StringUtil.NToC( (decimal)(edtPedidoLineaCantidad_Enabled), 5, 0, ".", "")));
         GxWebStd.gx_hidden_field( context, "PEDIDOLINEACOMENTARIOS_"+sGXsfl_76_idx+"Enabled", StringUtil.LTrim( StringUtil.NToC( (decimal)(edtPedidoLineaComentarios_Enabled), 5, 0, ".", "")));
         GxWebStd.gx_hidden_field( context, "PEDIDOLINEAESTADO_"+sGXsfl_76_idx+"Enabled", StringUtil.LTrim( StringUtil.NToC( (decimal)(edtPedidoLineaEstado_Enabled), 5, 0, ".", "")));
         GxWebStd.gx_hidden_field( context, "PEDIDOLINEAFHINICIO_"+sGXsfl_76_idx+"Enabled", StringUtil.LTrim( StringUtil.NToC( (decimal)(edtPedidoLineaFHInicio_Enabled), 5, 0, ".", "")));
         GxWebStd.gx_hidden_field( context, "PEDIDOLINEAFHFIN_"+sGXsfl_76_idx+"Enabled", StringUtil.LTrim( StringUtil.NToC( (decimal)(edtPedidoLineaFHFin_Enabled), 5, 0, ".", "")));
         GxWebStd.gx_hidden_field( context, "PEDIDOLINEAPRIORIDAD_"+sGXsfl_76_idx+"Enabled", StringUtil.LTrim( StringUtil.NToC( (decimal)(edtPedidoLineaPrioridad_Enabled), 5, 0, ".", "")));
         GxWebStd.gx_hidden_field( context, "PRODUCTOID_"+sGXsfl_76_idx+"Enabled", StringUtil.LTrim( StringUtil.NToC( (decimal)(edtProductoId_Enabled), 5, 0, ".", "")));
         GxWebStd.gx_hidden_field( context, "PRODUCTOPRECIO_"+sGXsfl_76_idx+"Enabled", StringUtil.LTrim( StringUtil.NToC( (decimal)(edtProductoPrecio_Enabled), 5, 0, ".", "")));
         GxWebStd.gx_hidden_field( context, "LINEAIMPORTE_"+sGXsfl_76_idx+"Enabled", StringUtil.LTrim( StringUtil.NToC( (decimal)(edtLineaImporte_Enabled), 5, 0, ".", "")));
         GxWebStd.gx_hidden_field( context, "PROMPT_16_"+sGXsfl_76_idx+"Link", StringUtil.RTrim( imgprompt_16_Link));
         context.httpAjaxContext.ajax_sending_grid_row(null);
         Gridpedido_lineaContainer.AddRow(Gridpedido_lineaRow);
      }

      protected void ReadRow012( )
      {
         nGXsfl_76_idx = (short)(nGXsfl_76_idx+1);
         sGXsfl_76_idx = StringUtil.PadL( StringUtil.LTrim( StringUtil.Str( (decimal)(nGXsfl_76_idx), 4, 0)), 4, "0");
         edtPedidoLineaId_Internalname = "PEDIDOLINEAID_"+sGXsfl_76_idx;
         edtPedidoLineaCantidad_Internalname = "PEDIDOLINEACANTIDAD_"+sGXsfl_76_idx;
         edtPedidoLineaComentarios_Internalname = "PEDIDOLINEACOMENTARIOS_"+sGXsfl_76_idx;
         edtPedidoLineaEstado_Internalname = "PEDIDOLINEAESTADO_"+sGXsfl_76_idx;
         edtPedidoLineaFHInicio_Internalname = "PEDIDOLINEAFHINICIO_"+sGXsfl_76_idx;
         edtPedidoLineaFHFin_Internalname = "PEDIDOLINEAFHFIN_"+sGXsfl_76_idx;
         edtPedidoLineaPrioridad_Internalname = "PEDIDOLINEAPRIORIDAD_"+sGXsfl_76_idx;
         edtProductoId_Internalname = "PRODUCTOID_"+sGXsfl_76_idx;
         imgprompt_16_Internalname = "PROMPT_16_"+sGXsfl_76_idx;
         edtProductoPrecio_Internalname = "PRODUCTOPRECIO_"+sGXsfl_76_idx;
         edtLineaImporte_Internalname = "LINEAIMPORTE_"+sGXsfl_76_idx;
         edtPedidoLineaId_Enabled = (int)(context.localUtil.CToN( cgiGet( "PEDIDOLINEAID_"+sGXsfl_76_idx+"Enabled"), ",", "."));
         edtPedidoLineaCantidad_Enabled = (int)(context.localUtil.CToN( cgiGet( "PEDIDOLINEACANTIDAD_"+sGXsfl_76_idx+"Enabled"), ",", "."));
         edtPedidoLineaComentarios_Enabled = (int)(context.localUtil.CToN( cgiGet( "PEDIDOLINEACOMENTARIOS_"+sGXsfl_76_idx+"Enabled"), ",", "."));
         edtPedidoLineaEstado_Enabled = (int)(context.localUtil.CToN( cgiGet( "PEDIDOLINEAESTADO_"+sGXsfl_76_idx+"Enabled"), ",", "."));
         edtPedidoLineaFHInicio_Enabled = (int)(context.localUtil.CToN( cgiGet( "PEDIDOLINEAFHINICIO_"+sGXsfl_76_idx+"Enabled"), ",", "."));
         edtPedidoLineaFHFin_Enabled = (int)(context.localUtil.CToN( cgiGet( "PEDIDOLINEAFHFIN_"+sGXsfl_76_idx+"Enabled"), ",", "."));
         edtPedidoLineaPrioridad_Enabled = (int)(context.localUtil.CToN( cgiGet( "PEDIDOLINEAPRIORIDAD_"+sGXsfl_76_idx+"Enabled"), ",", "."));
         edtProductoId_Enabled = (int)(context.localUtil.CToN( cgiGet( "PRODUCTOID_"+sGXsfl_76_idx+"Enabled"), ",", "."));
         edtProductoPrecio_Enabled = (int)(context.localUtil.CToN( cgiGet( "PRODUCTOPRECIO_"+sGXsfl_76_idx+"Enabled"), ",", "."));
         edtLineaImporte_Enabled = (int)(context.localUtil.CToN( cgiGet( "LINEAIMPORTE_"+sGXsfl_76_idx+"Enabled"), ",", "."));
         imgprompt_6_Link = cgiGet( "PROMPT_16_"+sGXsfl_76_idx+"Link");
         if ( ( ( context.localUtil.CToN( cgiGet( edtPedidoLineaId_Internalname), ",", ".") < Convert.ToDecimal( 0 )) ) || ( ( context.localUtil.CToN( cgiGet( edtPedidoLineaId_Internalname), ",", ".") > Convert.ToDecimal( 9999999999L )) ) )
         {
            GX_msglist.addItem(context.GetMessage( "GXM_badnum", ""), 1, "PEDIDOLINEAID");
            AnyError = 1;
            GX_FocusControl = edtPedidoLineaId_Internalname;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
            wbErr = true;
            A9PedidoLineaId = 0;
         }
         else
         {
            A9PedidoLineaId = (long)(context.localUtil.CToN( cgiGet( edtPedidoLineaId_Internalname), ",", "."));
         }
         if ( ( ( context.localUtil.CToN( cgiGet( edtPedidoLineaCantidad_Internalname), ",", ".") < Convert.ToDecimal( 0 )) ) || ( ( context.localUtil.CToN( cgiGet( edtPedidoLineaCantidad_Internalname), ",", ".") > Convert.ToDecimal( 999 )) ) )
         {
            GX_msglist.addItem(context.GetMessage( "GXM_badnum", ""), 1, "PEDIDOLINEACANTIDAD");
            AnyError = 1;
            GX_FocusControl = edtPedidoLineaCantidad_Internalname;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
            wbErr = true;
            A45PedidoLineaCantidad = 0;
         }
         else
         {
            A45PedidoLineaCantidad = (short)(context.localUtil.CToN( cgiGet( edtPedidoLineaCantidad_Internalname), ",", "."));
         }
         A46PedidoLineaComentarios = cgiGet( edtPedidoLineaComentarios_Internalname);
         A47PedidoLineaEstado = cgiGet( edtPedidoLineaEstado_Internalname);
         if ( context.localUtil.VCDateTime( cgiGet( edtPedidoLineaFHInicio_Internalname), 2, 0) == 0 )
         {
            GX_msglist.addItem(context.GetMessage( "GXM_baddatetime", new   object[]  {"Pedido Linea FHInicio"}), 1, "PEDIDOLINEAFHINICIO");
            AnyError = 1;
            GX_FocusControl = edtPedidoLineaFHInicio_Internalname;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
            wbErr = true;
            A48PedidoLineaFHInicio = (DateTime)(DateTime.MinValue);
         }
         else
         {
            A48PedidoLineaFHInicio = context.localUtil.CToT( cgiGet( edtPedidoLineaFHInicio_Internalname));
         }
         if ( context.localUtil.VCDateTime( cgiGet( edtPedidoLineaFHFin_Internalname), 2, 0) == 0 )
         {
            GX_msglist.addItem(context.GetMessage( "GXM_baddatetime", new   object[]  {"Pedido Linea FHFin"}), 1, "PEDIDOLINEAFHFIN");
            AnyError = 1;
            GX_FocusControl = edtPedidoLineaFHFin_Internalname;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
            wbErr = true;
            A49PedidoLineaFHFin = (DateTime)(DateTime.MinValue);
         }
         else
         {
            A49PedidoLineaFHFin = context.localUtil.CToT( cgiGet( edtPedidoLineaFHFin_Internalname));
         }
         if ( ( ( context.localUtil.CToN( cgiGet( edtPedidoLineaPrioridad_Internalname), ",", ".") < Convert.ToDecimal( 0 )) ) || ( ( context.localUtil.CToN( cgiGet( edtPedidoLineaPrioridad_Internalname), ",", ".") > Convert.ToDecimal( 9999 )) ) )
         {
            GX_msglist.addItem(context.GetMessage( "GXM_badnum", ""), 1, "PEDIDOLINEAPRIORIDAD");
            AnyError = 1;
            GX_FocusControl = edtPedidoLineaPrioridad_Internalname;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
            wbErr = true;
            A50PedidoLineaPrioridad = 0;
         }
         else
         {
            A50PedidoLineaPrioridad = (short)(context.localUtil.CToN( cgiGet( edtPedidoLineaPrioridad_Internalname), ",", "."));
         }
         if ( ( ( context.localUtil.CToN( cgiGet( edtProductoId_Internalname), ",", ".") < Convert.ToDecimal( 0 )) ) || ( ( context.localUtil.CToN( cgiGet( edtProductoId_Internalname), ",", ".") > Convert.ToDecimal( 9999999999L )) ) )
         {
            GX_msglist.addItem(context.GetMessage( "GXM_badnum", ""), 1, "PRODUCTOID");
            AnyError = 1;
            GX_FocusControl = edtProductoId_Internalname;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
            wbErr = true;
            A16ProductoId = 0;
            n16ProductoId = false;
         }
         else
         {
            A16ProductoId = (long)(context.localUtil.CToN( cgiGet( edtProductoId_Internalname), ",", "."));
            n16ProductoId = false;
         }
         A22ProductoPrecio = context.localUtil.CToN( cgiGet( edtProductoPrecio_Internalname), ",", ".");
         n22ProductoPrecio = false;
         A17LineaImporte = context.localUtil.CToN( cgiGet( edtLineaImporte_Internalname), ",", ".");
         n17LineaImporte = false;
         GXCCtl = "Z9PedidoLineaId_" + sGXsfl_76_idx;
         Z9PedidoLineaId = (long)(context.localUtil.CToN( cgiGet( GXCCtl), ",", "."));
         GXCCtl = "Z45PedidoLineaCantidad_" + sGXsfl_76_idx;
         Z45PedidoLineaCantidad = (short)(context.localUtil.CToN( cgiGet( GXCCtl), ",", "."));
         GXCCtl = "Z46PedidoLineaComentarios_" + sGXsfl_76_idx;
         Z46PedidoLineaComentarios = cgiGet( GXCCtl);
         GXCCtl = "Z47PedidoLineaEstado_" + sGXsfl_76_idx;
         Z47PedidoLineaEstado = cgiGet( GXCCtl);
         GXCCtl = "Z48PedidoLineaFHInicio_" + sGXsfl_76_idx;
         Z48PedidoLineaFHInicio = context.localUtil.CToT( cgiGet( GXCCtl), 0);
         GXCCtl = "Z49PedidoLineaFHFin_" + sGXsfl_76_idx;
         Z49PedidoLineaFHFin = context.localUtil.CToT( cgiGet( GXCCtl), 0);
         GXCCtl = "Z50PedidoLineaPrioridad_" + sGXsfl_76_idx;
         Z50PedidoLineaPrioridad = (short)(context.localUtil.CToN( cgiGet( GXCCtl), ",", "."));
         GXCCtl = "Z16ProductoId_" + sGXsfl_76_idx;
         Z16ProductoId = (long)(context.localUtil.CToN( cgiGet( GXCCtl), ",", "."));
         GXCCtl = "O17LineaImporte_" + sGXsfl_76_idx;
         O17LineaImporte = context.localUtil.CToN( cgiGet( GXCCtl), ",", ".");
         GXCCtl = "nRcdDeleted_2_" + sGXsfl_76_idx;
         nRcdDeleted_2 = (short)(context.localUtil.CToN( cgiGet( GXCCtl), ",", "."));
         GXCCtl = "nRcdExists_2_" + sGXsfl_76_idx;
         nRcdExists_2 = (short)(context.localUtil.CToN( cgiGet( GXCCtl), ",", "."));
         GXCCtl = "nIsMod_2_" + sGXsfl_76_idx;
         nIsMod_2 = (short)(context.localUtil.CToN( cgiGet( GXCCtl), ",", "."));
      }

      protected void assign_properties_default( )
      {
         defedtPedidoLineaId_Enabled = edtPedidoLineaId_Enabled;
      }

      protected void ConfirmValues010( )
      {
         nGXsfl_76_idx = 0;
         sGXsfl_76_idx = StringUtil.PadL( StringUtil.LTrim( StringUtil.Str( (decimal)(nGXsfl_76_idx), 4, 0)), 4, "0");
         edtPedidoLineaId_Internalname = "PEDIDOLINEAID_"+sGXsfl_76_idx;
         edtPedidoLineaCantidad_Internalname = "PEDIDOLINEACANTIDAD_"+sGXsfl_76_idx;
         edtPedidoLineaComentarios_Internalname = "PEDIDOLINEACOMENTARIOS_"+sGXsfl_76_idx;
         edtPedidoLineaEstado_Internalname = "PEDIDOLINEAESTADO_"+sGXsfl_76_idx;
         edtPedidoLineaFHInicio_Internalname = "PEDIDOLINEAFHINICIO_"+sGXsfl_76_idx;
         edtPedidoLineaFHFin_Internalname = "PEDIDOLINEAFHFIN_"+sGXsfl_76_idx;
         edtPedidoLineaPrioridad_Internalname = "PEDIDOLINEAPRIORIDAD_"+sGXsfl_76_idx;
         edtProductoId_Internalname = "PRODUCTOID_"+sGXsfl_76_idx;
         imgprompt_16_Internalname = "PROMPT_16_"+sGXsfl_76_idx;
         edtProductoPrecio_Internalname = "PRODUCTOPRECIO_"+sGXsfl_76_idx;
         edtLineaImporte_Internalname = "LINEAIMPORTE_"+sGXsfl_76_idx;
         while ( nGXsfl_76_idx < nRC_Gridpedido_linea )
         {
            nGXsfl_76_idx = (short)(nGXsfl_76_idx+1);
            sGXsfl_76_idx = StringUtil.PadL( StringUtil.LTrim( StringUtil.Str( (decimal)(nGXsfl_76_idx), 4, 0)), 4, "0");
            edtPedidoLineaId_Internalname = "PEDIDOLINEAID_"+sGXsfl_76_idx;
            edtPedidoLineaCantidad_Internalname = "PEDIDOLINEACANTIDAD_"+sGXsfl_76_idx;
            edtPedidoLineaComentarios_Internalname = "PEDIDOLINEACOMENTARIOS_"+sGXsfl_76_idx;
            edtPedidoLineaEstado_Internalname = "PEDIDOLINEAESTADO_"+sGXsfl_76_idx;
            edtPedidoLineaFHInicio_Internalname = "PEDIDOLINEAFHINICIO_"+sGXsfl_76_idx;
            edtPedidoLineaFHFin_Internalname = "PEDIDOLINEAFHFIN_"+sGXsfl_76_idx;
            edtPedidoLineaPrioridad_Internalname = "PEDIDOLINEAPRIORIDAD_"+sGXsfl_76_idx;
            edtProductoId_Internalname = "PRODUCTOID_"+sGXsfl_76_idx;
            imgprompt_16_Internalname = "PROMPT_16_"+sGXsfl_76_idx;
            edtProductoPrecio_Internalname = "PRODUCTOPRECIO_"+sGXsfl_76_idx;
            edtLineaImporte_Internalname = "LINEAIMPORTE_"+sGXsfl_76_idx;
            ChangePostValue( "Z9PedidoLineaId_"+sGXsfl_76_idx, cgiGet( "ZT_"+"Z9PedidoLineaId_"+sGXsfl_76_idx)) ;
            DeletePostValue( "ZT_"+"Z9PedidoLineaId_"+sGXsfl_76_idx) ;
            ChangePostValue( "Z45PedidoLineaCantidad_"+sGXsfl_76_idx, cgiGet( "ZT_"+"Z45PedidoLineaCantidad_"+sGXsfl_76_idx)) ;
            DeletePostValue( "ZT_"+"Z45PedidoLineaCantidad_"+sGXsfl_76_idx) ;
            ChangePostValue( "Z46PedidoLineaComentarios_"+sGXsfl_76_idx, cgiGet( "ZT_"+"Z46PedidoLineaComentarios_"+sGXsfl_76_idx)) ;
            DeletePostValue( "ZT_"+"Z46PedidoLineaComentarios_"+sGXsfl_76_idx) ;
            ChangePostValue( "Z47PedidoLineaEstado_"+sGXsfl_76_idx, cgiGet( "ZT_"+"Z47PedidoLineaEstado_"+sGXsfl_76_idx)) ;
            DeletePostValue( "ZT_"+"Z47PedidoLineaEstado_"+sGXsfl_76_idx) ;
            ChangePostValue( "Z48PedidoLineaFHInicio_"+sGXsfl_76_idx, cgiGet( "ZT_"+"Z48PedidoLineaFHInicio_"+sGXsfl_76_idx)) ;
            DeletePostValue( "ZT_"+"Z48PedidoLineaFHInicio_"+sGXsfl_76_idx) ;
            ChangePostValue( "Z49PedidoLineaFHFin_"+sGXsfl_76_idx, cgiGet( "ZT_"+"Z49PedidoLineaFHFin_"+sGXsfl_76_idx)) ;
            DeletePostValue( "ZT_"+"Z49PedidoLineaFHFin_"+sGXsfl_76_idx) ;
            ChangePostValue( "Z50PedidoLineaPrioridad_"+sGXsfl_76_idx, cgiGet( "ZT_"+"Z50PedidoLineaPrioridad_"+sGXsfl_76_idx)) ;
            DeletePostValue( "ZT_"+"Z50PedidoLineaPrioridad_"+sGXsfl_76_idx) ;
            ChangePostValue( "Z16ProductoId_"+sGXsfl_76_idx, cgiGet( "ZT_"+"Z16ProductoId_"+sGXsfl_76_idx)) ;
            DeletePostValue( "ZT_"+"Z16ProductoId_"+sGXsfl_76_idx) ;
         }
         ChangePostValue( "O17LineaImporte", cgiGet( "T17LineaImporte")) ;
         DeletePostValue( "T17LineaImporte") ;
      }

      public override void RenderHtmlHeaders( )
      {
         GxWebStd.gx_html_headers( context, 0, "", "", Form.Meta, Form.Metaequiv, "IE=EmulateIE7");
      }

      public override void RenderHtmlOpenForm( )
      {
         context.WriteHtmlText( "<title>") ;
         context.SendWebValue( Form.Caption) ;
         context.WriteHtmlTextNl( "</title>") ;
         if ( StringUtil.Len( sDynURL) > 0 )
         {
            context.WriteHtmlText( "<BASE href=\""+sDynURL+"\" />") ;
         }
         define_styles( ) ;
         MasterPageObj.master_styles();
         if ( ! context.isSmartDevice( ) )
         {
            context.AddJavascriptSource("gxtimezone.js", "?"+context.GetBuildNumber( 75733));
            context.AddJavascriptSource("gxgral.js", "?"+context.GetBuildNumber( 75733));
            context.AddJavascriptSource("gxcfg.js", "?"+context.GetBuildNumber( 75733));
         }
         else
         {
            context.AddJavascriptSource("gxtimezone.js", "?"+context.GetBuildNumber( 75733));
            context.AddJavascriptSource("gxapiSD.js", "?"+context.GetBuildNumber( 75733));
            context.AddJavascriptSource("gxfxSD.js", "?"+context.GetBuildNumber( 75733));
            context.AddJavascriptSource("gxhtmlSD.js", "?"+context.GetBuildNumber( 75733));
            context.AddJavascriptSource("gxtypesSD.js", "?"+context.GetBuildNumber( 75733));
            context.AddJavascriptSource("gxpopupSD.js", "?"+context.GetBuildNumber( 75733));
            context.AddJavascriptSource("gxfrmutlSD.js", "?"+context.GetBuildNumber( 75733));
            context.AddJavascriptSource("gxgridSD.js", "?"+context.GetBuildNumber( 75733));
            context.AddJavascriptSource("JavaScripTableSD.js", "?"+context.GetBuildNumber( 75733));
            context.AddJavascriptSource("rijndaelSD.js", "?"+context.GetBuildNumber( 75733));
            context.AddJavascriptSource("gxgralSD.js", "?"+context.GetBuildNumber( 75733));
            context.AddJavascriptSource("gxcfg.js", "?"+context.GetBuildNumber( 75733));
         }
         context.AddJavascriptSource("calendar.js", "?"+context.GetBuildNumber( 75733));
         context.AddJavascriptSource("calendar-setup.js", "?"+context.GetBuildNumber( 75733));
         context.AddJavascriptSource("calendar-es.js", "?"+context.GetBuildNumber( 75733));
         context.WriteHtmlText( Form.Headerrawhtml) ;
         context.CloseHtmlHeader();
         FormProcess = " onkeyup=\"gx.evt.onkeyup(event)\" onkeypress=\"gx.evt.onkeypress(event,true,false)\" onkeydown=\"gx.evt.onkeypress(null,true,false)\"";
         context.WriteHtmlText( "<body") ;
         context.WriteHtmlText( " "+"class=\"Form\""+" "+" style=\"-moz-opacity:0;opacity:0;"+"background-color:"+context.BuildHTMLColor( Form.Backcolor)+";") ;
         if ( ! ( String.IsNullOrEmpty(StringUtil.RTrim( Form.Background)) ) )
         {
            context.WriteHtmlText( " background-image:url("+context.convertURL( Form.Background)+")") ;
         }
         context.WriteHtmlText( "\""+FormProcess+">") ;
         context.skipLines(1);
         context.WriteHtmlTextNl( "<form id=\"MAINFORM\" onsubmit=\"try{return gx.csv.validForm()}catch(e){return true;}\" name=\"MAINFORM\" method=\"post\" class=\"Form\" novalidate action=\""+formatLink("pedido.aspx") +"\">") ;
         GxWebStd.gx_hidden_field( context, "_EventName", "");
         GxWebStd.gx_hidden_field( context, "_EventGridId", "");
         GxWebStd.gx_hidden_field( context, "_EventRowId", "");
      }

      public override void RenderHtmlCloseForm( )
      {
         /* Send hidden variables. */
         /* Send saved values. */
         GxWebStd.gx_hidden_field( context, "Z1PedidoId", StringUtil.LTrim( StringUtil.NToC( (decimal)(Z1PedidoId), 10, 0, ",", "")));
         GxWebStd.gx_hidden_field( context, "Z53PedidoCantidadPersonas", StringUtil.LTrim( StringUtil.NToC( (decimal)(Z53PedidoCantidadPersonas), 4, 0, ",", "")));
         GxWebStd.gx_hidden_field( context, "Z54PedidoEstado", StringUtil.RTrim( Z54PedidoEstado));
         GxWebStd.gx_hidden_field( context, "Z55PedidoFHFin", context.localUtil.TToC( Z55PedidoFHFin, 10, 8, 0, 0, "/", ":", " "));
         GxWebStd.gx_hidden_field( context, "Z56PedidoFHInicio", context.localUtil.TToC( Z56PedidoFHInicio, 10, 8, 0, 0, "/", ":", " "));
         GxWebStd.gx_hidden_field( context, "Z57PedidoTipo", StringUtil.RTrim( Z57PedidoTipo));
         GxWebStd.gx_hidden_field( context, "Z6MesaId", StringUtil.LTrim( StringUtil.NToC( (decimal)(Z6MesaId), 10, 0, ",", "")));
         GxWebStd.gx_hidden_field( context, "O8ImporteTotal", StringUtil.LTrim( StringUtil.NToC( O8ImporteTotal, 5, 2, ",", "")));
         GxWebStd.gx_hidden_field( context, "IsConfirmed", StringUtil.LTrim( StringUtil.NToC( (decimal)(IsConfirmed), 4, 0, ",", "")));
         GxWebStd.gx_hidden_field( context, "IsModified", StringUtil.LTrim( StringUtil.NToC( (decimal)(IsModified), 4, 0, ",", "")));
         GxWebStd.gx_hidden_field( context, "Mode", StringUtil.RTrim( Gx_mode));
         GxWebStd.gx_hidden_field( context, "nRC_Gridpedido_linea", StringUtil.LTrim( StringUtil.NToC( (decimal)(nGXsfl_76_idx), 4, 0, ",", "")));
         GxWebStd.gx_hidden_field( context, "vMODE", StringUtil.RTrim( Gx_mode));
         GxWebStd.gx_hidden_field( context, "GX_FocusControl", GX_FocusControl);
         SendAjaxEncryptionKey();
         SendComponentObjects();
         SendServerCommands();
         SendState();
         context.WriteHtmlTextNl( "</form>") ;
         include_jscripts( ) ;
      }

      public override short ExecuteStartEvent( )
      {
         standaloneStartup( ) ;
         gxajaxcallmode = (short)((isAjaxCallMode( ) ? 1 : 0));
         return gxajaxcallmode ;
      }

      public override void RenderHtmlContent( )
      {
         Draw( ) ;
      }

      public override void DispatchEvents( )
      {
         Process( ) ;
      }

      public override bool HasEnterEvent( )
      {
         return true ;
      }

      public override String GetPgmname( )
      {
         return "Pedido" ;
      }

      public override String GetPgmdesc( )
      {
         return "Pedido" ;
      }

      public override GXWebForm GetForm( )
      {
         return Form ;
      }

      public override String GetSelfLink( )
      {
         return formatLink("pedido.aspx")  ;
      }

      protected void InitializeNonKey011( )
      {
         A53PedidoCantidadPersonas = 0;
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A53PedidoCantidadPersonas", StringUtil.LTrim( StringUtil.Str( (decimal)(A53PedidoCantidadPersonas), 4, 0)));
         A54PedidoEstado = "";
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A54PedidoEstado", A54PedidoEstado);
         A55PedidoFHFin = (DateTime)(DateTime.MinValue);
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A55PedidoFHFin", context.localUtil.TToC( A55PedidoFHFin, 8, 5, 0, 3, "/", ":", " "));
         A56PedidoFHInicio = (DateTime)(DateTime.MinValue);
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A56PedidoFHInicio", context.localUtil.TToC( A56PedidoFHInicio, 8, 5, 0, 3, "/", ":", " "));
         A6MesaId = 0;
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A6MesaId", StringUtil.LTrim( StringUtil.Str( (decimal)(A6MesaId), 10, 0)));
         A57PedidoTipo = "";
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A57PedidoTipo", A57PedidoTipo);
         A8ImporteTotal = 0;
         n8ImporteTotal = false;
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A8ImporteTotal", StringUtil.LTrim( StringUtil.Str( A8ImporteTotal, 5, 2)));
         O8ImporteTotal = A8ImporteTotal;
         n8ImporteTotal = false;
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A8ImporteTotal", StringUtil.LTrim( StringUtil.Str( A8ImporteTotal, 5, 2)));
      }

      protected void InitAll011( )
      {
         A1PedidoId = 0;
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A1PedidoId", StringUtil.LTrim( StringUtil.Str( (decimal)(A1PedidoId), 10, 0)));
         InitializeNonKey011( ) ;
      }

      protected void StandaloneModalInsert( )
      {
      }

      protected void InitializeNonKey012( )
      {
         A45PedidoLineaCantidad = 0;
         A46PedidoLineaComentarios = "";
         A47PedidoLineaEstado = "";
         A48PedidoLineaFHInicio = (DateTime)(DateTime.MinValue);
         A49PedidoLineaFHFin = (DateTime)(DateTime.MinValue);
         A50PedidoLineaPrioridad = 0;
         A16ProductoId = 0;
         n16ProductoId = false;
         A22ProductoPrecio = 0;
         n22ProductoPrecio = false;
         A17LineaImporte = 0;
         n17LineaImporte = false;
         O17LineaImporte = A17LineaImporte;
         n17LineaImporte = false;
      }

      protected void InitAll012( )
      {
         A9PedidoLineaId = 0;
         InitializeNonKey012( ) ;
      }

      protected void StandaloneModalInsert012( )
      {
      }

      protected void define_styles( )
      {
         AddStyleSheetFile("calendar-system.css", "?1316260");
         AddThemeStyleSheetFile("", context.GetTheme( )+".css", "?22151370");
         idxLst = 1;
         while ( idxLst <= Form.Jscriptsrc.Count )
         {
            context.AddJavascriptSource(StringUtil.RTrim( Form.Jscriptsrc.Item(idxLst)), "?201471722152017");
            idxLst = (int)(idxLst+1);
         }
         /* End function define_styles */
      }

      protected void include_jscripts( )
      {
         context.AddJavascriptSource("messages.spa.js", "?"+context.GetBuildNumber( 75733));
         context.AddJavascriptSource("pedido.js", "?201471722152017");
         /* End function include_jscripts */
      }

      protected void init_level_properties2( )
      {
         edtPedidoLineaId_Enabled = defedtPedidoLineaId_Enabled;
      }

      protected void init_default_properties( )
      {
         imgBtn_first_Internalname = "BTN_FIRST";
         imgBtn_first_separator_Internalname = "BTN_FIRST_SEPARATOR";
         imgBtn_previous_Internalname = "BTN_PREVIOUS";
         imgBtn_previous_separator_Internalname = "BTN_PREVIOUS_SEPARATOR";
         imgBtn_next_Internalname = "BTN_NEXT";
         imgBtn_next_separator_Internalname = "BTN_NEXT_SEPARATOR";
         imgBtn_last_Internalname = "BTN_LAST";
         imgBtn_last_separator_Internalname = "BTN_LAST_SEPARATOR";
         imgBtn_select_Internalname = "BTN_SELECT";
         imgBtn_select_separator_Internalname = "BTN_SELECT_SEPARATOR";
         imgBtn_enter2_Internalname = "BTN_ENTER2";
         imgBtn_enter2_separator_Internalname = "BTN_ENTER2_SEPARATOR";
         imgBtn_cancel2_Internalname = "BTN_CANCEL2";
         imgBtn_cancel2_separator_Internalname = "BTN_CANCEL2_SEPARATOR";
         imgBtn_delete2_Internalname = "BTN_DELETE2";
         imgBtn_delete2_separator_Internalname = "BTN_DELETE2_SEPARATOR";
         divSectiontoolbar_Internalname = "SECTIONTOOLBAR";
         tblTabletoolbar_Internalname = "TABLETOOLBAR";
         lblTextblockpedidoid_Internalname = "TEXTBLOCKPEDIDOID";
         edtPedidoId_Internalname = "PEDIDOID";
         lblTextblockpedidocantidadpersonas_Internalname = "TEXTBLOCKPEDIDOCANTIDADPERSONAS";
         edtPedidoCantidadPersonas_Internalname = "PEDIDOCANTIDADPERSONAS";
         lblTextblockpedidoestado_Internalname = "TEXTBLOCKPEDIDOESTADO";
         edtPedidoEstado_Internalname = "PEDIDOESTADO";
         lblTextblockpedidofhfin_Internalname = "TEXTBLOCKPEDIDOFHFIN";
         edtPedidoFHFin_Internalname = "PEDIDOFHFIN";
         lblTextblockpedidofhinicio_Internalname = "TEXTBLOCKPEDIDOFHINICIO";
         edtPedidoFHInicio_Internalname = "PEDIDOFHINICIO";
         lblTextblockmesaid_Internalname = "TEXTBLOCKMESAID";
         edtMesaId_Internalname = "MESAID";
         lblTextblockpedidotipo_Internalname = "TEXTBLOCKPEDIDOTIPO";
         edtPedidoTipo_Internalname = "PEDIDOTIPO";
         lblTitlelinea_Internalname = "TITLELINEA";
         tblTable3_Internalname = "TABLE3";
         lblTextblockimportetotal_Internalname = "TEXTBLOCKIMPORTETOTAL";
         edtImporteTotal_Internalname = "IMPORTETOTAL";
         tblTable2_Internalname = "TABLE2";
         bttBtn_enter_Internalname = "BTN_ENTER";
         bttBtn_cancel_Internalname = "BTN_CANCEL";
         bttBtn_delete_Internalname = "BTN_DELETE";
         tblTable1_Internalname = "TABLE1";
         grpGroupdata_Internalname = "GROUPDATA";
         tblTablemain_Internalname = "TABLEMAIN";
         Form.Internalname = "FORM";
         imgprompt_6_Internalname = "PROMPT_6";
         subGridpedido_linea_Internalname = "GRIDPEDIDO_LINEA";
      }

      public override void initialize_properties( )
      {
         init_default_properties( ) ;
         Form.Headerrawhtml = "";
         Form.Background = "";
         Form.Backcolor = (int)(0xFFFFFF);
         Form.Caption = "Pedido";
         edtLineaImporte_Jsonclick = "";
         edtProductoPrecio_Jsonclick = "";
         imgprompt_16_Visible = 1;
         imgprompt_16_Link = "";
         imgprompt_6_Visible = 1;
         edtProductoId_Jsonclick = "";
         edtPedidoLineaPrioridad_Jsonclick = "";
         edtPedidoLineaFHFin_Jsonclick = "";
         edtPedidoLineaFHInicio_Jsonclick = "";
         edtPedidoLineaEstado_Jsonclick = "";
         edtPedidoLineaComentarios_Jsonclick = "";
         edtPedidoLineaCantidad_Jsonclick = "";
         edtPedidoLineaId_Jsonclick = "";
         subGridpedido_linea_Class = "Grid";
         imgBtn_delete2_separator_Visible = 1;
         imgBtn_delete2_Enabled = 1;
         imgBtn_delete2_Visible = 1;
         imgBtn_cancel2_separator_Visible = 1;
         imgBtn_cancel2_Visible = 1;
         imgBtn_enter2_separator_Visible = 1;
         imgBtn_enter2_Enabled = 1;
         imgBtn_enter2_Visible = 1;
         imgBtn_select_separator_Visible = 1;
         imgBtn_select_Visible = 1;
         imgBtn_last_separator_Visible = 1;
         imgBtn_last_Visible = 1;
         imgBtn_next_separator_Visible = 1;
         imgBtn_next_Visible = 1;
         imgBtn_previous_separator_Visible = 1;
         imgBtn_previous_Visible = 1;
         imgBtn_first_separator_Visible = 1;
         imgBtn_first_Visible = 1;
         edtImporteTotal_Jsonclick = "";
         edtImporteTotal_Enabled = 0;
         subGridpedido_linea_Allowcollapsing = 0;
         subGridpedido_linea_Allowselection = 0;
         edtLineaImporte_Enabled = 0;
         edtProductoPrecio_Enabled = 0;
         edtProductoId_Enabled = 1;
         edtPedidoLineaPrioridad_Enabled = 1;
         edtPedidoLineaFHFin_Enabled = 1;
         edtPedidoLineaFHInicio_Enabled = 1;
         edtPedidoLineaEstado_Enabled = 1;
         edtPedidoLineaComentarios_Enabled = 1;
         edtPedidoLineaCantidad_Enabled = 1;
         edtPedidoLineaId_Enabled = 1;
         subGridpedido_linea_Backcolorstyle = 2;
         edtPedidoTipo_Jsonclick = "";
         edtPedidoTipo_Enabled = 1;
         imgprompt_6_Visible = 1;
         imgprompt_6_Link = "";
         edtMesaId_Jsonclick = "";
         edtMesaId_Enabled = 1;
         edtPedidoFHInicio_Jsonclick = "";
         edtPedidoFHInicio_Enabled = 1;
         edtPedidoFHFin_Jsonclick = "";
         edtPedidoFHFin_Enabled = 1;
         edtPedidoEstado_Jsonclick = "";
         edtPedidoEstado_Enabled = 1;
         edtPedidoCantidadPersonas_Jsonclick = "";
         edtPedidoCantidadPersonas_Enabled = 1;
         edtPedidoId_Jsonclick = "";
         edtPedidoId_Enabled = 1;
         bttBtn_delete_Visible = 1;
         bttBtn_cancel_Visible = 1;
         bttBtn_enter_Visible = 1;
         context.GX_msglist.DisplayMode = 1;
      }

      protected void dynload_actions( )
      {
         /* End function dynload_actions */
      }

      protected void gxnrGridpedido_linea_newrow( short nRC_Gridpedido_linea ,
                                                  short nGXsfl_76_idx ,
                                                  String sGXsfl_76_idx )
      {
         GxWebStd.set_html_headers( context, 0, "", "");
         Gx_mode = "INS";
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
         edtPedidoLineaId_Internalname = "PEDIDOLINEAID_"+sGXsfl_76_idx;
         edtPedidoLineaCantidad_Internalname = "PEDIDOLINEACANTIDAD_"+sGXsfl_76_idx;
         edtPedidoLineaComentarios_Internalname = "PEDIDOLINEACOMENTARIOS_"+sGXsfl_76_idx;
         edtPedidoLineaEstado_Internalname = "PEDIDOLINEAESTADO_"+sGXsfl_76_idx;
         edtPedidoLineaFHInicio_Internalname = "PEDIDOLINEAFHINICIO_"+sGXsfl_76_idx;
         edtPedidoLineaFHFin_Internalname = "PEDIDOLINEAFHFIN_"+sGXsfl_76_idx;
         edtPedidoLineaPrioridad_Internalname = "PEDIDOLINEAPRIORIDAD_"+sGXsfl_76_idx;
         edtProductoId_Internalname = "PRODUCTOID_"+sGXsfl_76_idx;
         imgprompt_16_Internalname = "PROMPT_16_"+sGXsfl_76_idx;
         edtProductoPrecio_Internalname = "PRODUCTOPRECIO_"+sGXsfl_76_idx;
         edtLineaImporte_Internalname = "LINEAIMPORTE_"+sGXsfl_76_idx;
         while ( nGXsfl_76_idx <= nRC_Gridpedido_linea )
         {
            standaloneNotModal( ) ;
            standaloneModal( ) ;
            standaloneNotModal012( ) ;
            standaloneModal012( ) ;
            dynload_actions( ) ;
            SendRow012( ) ;
            nGXsfl_76_idx = (short)(nGXsfl_76_idx+1);
            sGXsfl_76_idx = StringUtil.PadL( StringUtil.LTrim( StringUtil.Str( (decimal)(nGXsfl_76_idx), 4, 0)), 4, "0");
            edtPedidoLineaId_Internalname = "PEDIDOLINEAID_"+sGXsfl_76_idx;
            edtPedidoLineaCantidad_Internalname = "PEDIDOLINEACANTIDAD_"+sGXsfl_76_idx;
            edtPedidoLineaComentarios_Internalname = "PEDIDOLINEACOMENTARIOS_"+sGXsfl_76_idx;
            edtPedidoLineaEstado_Internalname = "PEDIDOLINEAESTADO_"+sGXsfl_76_idx;
            edtPedidoLineaFHInicio_Internalname = "PEDIDOLINEAFHINICIO_"+sGXsfl_76_idx;
            edtPedidoLineaFHFin_Internalname = "PEDIDOLINEAFHFIN_"+sGXsfl_76_idx;
            edtPedidoLineaPrioridad_Internalname = "PEDIDOLINEAPRIORIDAD_"+sGXsfl_76_idx;
            edtProductoId_Internalname = "PRODUCTOID_"+sGXsfl_76_idx;
            imgprompt_16_Internalname = "PROMPT_16_"+sGXsfl_76_idx;
            edtProductoPrecio_Internalname = "PRODUCTOPRECIO_"+sGXsfl_76_idx;
            edtLineaImporte_Internalname = "LINEAIMPORTE_"+sGXsfl_76_idx;
         }
         context.GX_webresponse.AddString(Gridpedido_lineaContainer.ToJavascriptSource());
         /* End function gxnrGridpedido_linea_newrow */
      }

      protected void AfterKeyLoadScreen( )
      {
         IsConfirmed = 0;
         getEqualNoModal( ) ;
         GX_FocusControl = edtPedidoCantidadPersonas_Internalname;
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
         standaloneNotModal( ) ;
         standaloneModal( ) ;
         /* End function AfterKeyLoadScreen */
      }

      public void Valid_Pedidoid( long GX_Parm1 ,
                                  short GX_Parm2 ,
                                  String GX_Parm3 ,
                                  DateTime GX_Parm4 ,
                                  DateTime GX_Parm5 ,
                                  String GX_Parm6 ,
                                  long GX_Parm7 ,
                                  decimal GX_Parm8 )
      {
         A1PedidoId = GX_Parm1;
         A53PedidoCantidadPersonas = GX_Parm2;
         A54PedidoEstado = GX_Parm3;
         A55PedidoFHFin = GX_Parm4;
         A56PedidoFHInicio = GX_Parm5;
         A57PedidoTipo = GX_Parm6;
         A6MesaId = GX_Parm7;
         A8ImporteTotal = GX_Parm8;
         n8ImporteTotal = false;
         context.wbHandled = 1;
         AfterKeyLoadScreen( ) ;
         Draw( ) ;
         /* Using cursor T000133 */
         pr_default.execute(18, new Object[] {A1PedidoId});
         if ( (pr_default.getStatus(18) != 101) )
         {
            A8ImporteTotal = T000133_A8ImporteTotal[0];
            n8ImporteTotal = T000133_n8ImporteTotal[0];
         }
         else
         {
            A8ImporteTotal = 0;
            n8ImporteTotal = false;
         }
         pr_default.close(18);
         dynload_actions( ) ;
         if ( AnyError == 1 )
         {
            A8ImporteTotal = 0;
            n8ImporteTotal = false;
         }
         isValidOutput.Add((Object)(StringUtil.LTrim( StringUtil.NToC( (decimal)(A53PedidoCantidadPersonas), 4, 0, ".", ""))));
         isValidOutput.Add((Object)(StringUtil.RTrim( A54PedidoEstado)));
         isValidOutput.Add((Object)(context.localUtil.Format(A55PedidoFHFin, "99/99/99 99:99")));
         isValidOutput.Add((Object)(context.localUtil.Format(A56PedidoFHInicio, "99/99/99 99:99")));
         isValidOutput.Add((Object)(StringUtil.LTrim( StringUtil.NToC( (decimal)(A6MesaId), 10, 0, ".", ""))));
         isValidOutput.Add((Object)(StringUtil.RTrim( A57PedidoTipo)));
         isValidOutput.Add((Object)(StringUtil.LTrim( StringUtil.NToC( A8ImporteTotal, 5, 2, ".", ""))));
         isValidOutput.Add((Object)(StringUtil.RTrim( Gx_mode)));
         isValidOutput.Add((Object)(StringUtil.LTrim( StringUtil.NToC( (decimal)(Z1PedidoId), 10, 0, ",", ""))));
         isValidOutput.Add((Object)(StringUtil.LTrim( StringUtil.NToC( (decimal)(Z53PedidoCantidadPersonas), 4, 0, ",", ""))));
         isValidOutput.Add((Object)(StringUtil.RTrim( Z54PedidoEstado)));
         isValidOutput.Add((Object)(context.localUtil.TToC( Z55PedidoFHFin, 10, 8, 0, 0, "/", ":", " ")));
         isValidOutput.Add((Object)(context.localUtil.TToC( Z56PedidoFHInicio, 10, 8, 0, 0, "/", ":", " ")));
         isValidOutput.Add((Object)(StringUtil.LTrim( StringUtil.NToC( (decimal)(Z6MesaId), 10, 0, ",", ""))));
         isValidOutput.Add((Object)(StringUtil.RTrim( Z57PedidoTipo)));
         isValidOutput.Add((Object)(StringUtil.LTrim( StringUtil.NToC( Z8ImporteTotal, 5, 2, ".", ""))));
         isValidOutput.Add((Object)(StringUtil.LTrim( StringUtil.NToC( O8ImporteTotal, 5, 2, ",", ""))));
         isValidOutput.Add((Object)(Gridpedido_lineaContainer));
         isValidOutput.Add((Object)(imgBtn_delete2_Enabled));
         isValidOutput.Add((Object)(imgBtn_enter2_Enabled));
         isValidOutput.Add((Object)(context.GX_msglist.ToJavascriptSource()));
         context.GX_webresponse.AddString(isValidOutput.ToJSonString());
         wbTemp = context.ResponseContentType( "application/json");
      }

      public void Valid_Mesaid( long GX_Parm1 )
      {
         A6MesaId = GX_Parm1;
         /* Using cursor T000147 */
         pr_default.execute(29, new Object[] {A6MesaId});
         if ( (pr_default.getStatus(29) == 101) )
         {
            GX_msglist.addItem("No existe 'Mesa'.", "ForeignKeyNotFound", 1, "MESAID");
            AnyError = 1;
            GX_FocusControl = edtMesaId_Internalname;
         }
         pr_default.close(29);
         dynload_actions( ) ;
         isValidOutput.Add((Object)(context.GX_msglist.ToJavascriptSource()));
         context.GX_webresponse.AddString(isValidOutput.ToJSonString());
         wbTemp = context.ResponseContentType( "application/json");
      }

      public void Valid_Productoid( String GX_Parm1 ,
                                    decimal GX_Parm2 ,
                                    decimal GX_Parm3 ,
                                    long GX_Parm4 ,
                                    short GX_Parm5 ,
                                    decimal GX_Parm6 ,
                                    decimal GX_Parm7 ,
                                    decimal GX_Parm8 )
      {
         Gx_mode = GX_Parm1;
         O17LineaImporte = GX_Parm2;
         O8ImporteTotal = GX_Parm3;
         A16ProductoId = GX_Parm4;
         n16ProductoId = false;
         A45PedidoLineaCantidad = GX_Parm5;
         A22ProductoPrecio = GX_Parm6;
         n22ProductoPrecio = false;
         A17LineaImporte = GX_Parm7;
         n17LineaImporte = false;
         A8ImporteTotal = GX_Parm8;
         n8ImporteTotal = false;
         /* Using cursor T000148 */
         pr_default.execute(30, new Object[] {n16ProductoId, A16ProductoId});
         if ( (pr_default.getStatus(30) == 101) )
         {
            GX_msglist.addItem("No existe 'Producto'.", "ForeignKeyNotFound", 1, "PRODUCTOID");
            AnyError = 1;
            GX_FocusControl = edtProductoId_Internalname;
         }
         pr_default.close(30);
         /* Using cursor T000145 */
         pr_default.execute(27, new Object[] {n16ProductoId, A16ProductoId});
         if ( (pr_default.getStatus(27) != 101) )
         {
            A22ProductoPrecio = T000145_A22ProductoPrecio[0];
            n22ProductoPrecio = T000145_n22ProductoPrecio[0];
            A22ProductoPrecio = T000145_A22ProductoPrecio[0];
            n22ProductoPrecio = T000145_n22ProductoPrecio[0];
         }
         else
         {
            A22ProductoPrecio = 0;
            n22ProductoPrecio = false;
         }
         pr_default.close(27);
         A17LineaImporte = (decimal)(A45PedidoLineaCantidad*A22ProductoPrecio);
         n17LineaImporte = false;
         dynload_actions( ) ;
         if ( AnyError == 1 )
         {
            A22ProductoPrecio = 0;
            n22ProductoPrecio = false;
            A8ImporteTotal = 0;
            n8ImporteTotal = false;
         }
         isValidOutput.Add((Object)(StringUtil.LTrim( StringUtil.NToC( A22ProductoPrecio, 5, 2, ".", ""))));
         isValidOutput.Add((Object)(StringUtil.LTrim( StringUtil.NToC( A17LineaImporte, 5, 2, ".", ""))));
         isValidOutput.Add((Object)(StringUtil.LTrim( StringUtil.NToC( A8ImporteTotal, 5, 2, ".", ""))));
         isValidOutput.Add((Object)(context.GX_msglist.ToJavascriptSource()));
         context.GX_webresponse.AddString(isValidOutput.ToJSonString());
         wbTemp = context.ResponseContentType( "application/json");
      }

      public void cleanup( )
      {
         flushBuffer();
         CloseOpenCursors();
         if ( IsMain )
         {
            context.CloseConnections() ;
         }
      }

      protected void CloseOpenCursors( )
      {
         pr_default.close(28);
         pr_default.close(30);
         pr_default.close(27);
         pr_default.close(19);
         pr_default.close(13);
         pr_default.close(12);
         pr_default.close(29);
         pr_default.close(18);
      }

      public override void initialize( )
      {
         sPrefix = "";
         scmdbuf = "";
         gxfirstwebparm = "";
         gxfirstwebparm_bkp = "";
         GXKey = "";
         PreviousTooltip = "";
         PreviousCaption = "";
         Form = new GXWebForm();
         GX_FocusControl = "";
         sStyleString = "";
         ClassString = "";
         StyleString = "";
         TempTags = "";
         bttBtn_enter_Jsonclick = "";
         bttBtn_cancel_Jsonclick = "";
         bttBtn_delete_Jsonclick = "";
         lblTextblockpedidoid_Jsonclick = "";
         lblTextblockpedidocantidadpersonas_Jsonclick = "";
         lblTextblockpedidoestado_Jsonclick = "";
         A54PedidoEstado = "";
         lblTextblockpedidofhfin_Jsonclick = "";
         A55PedidoFHFin = (DateTime)(DateTime.MinValue);
         lblTextblockpedidofhinicio_Jsonclick = "";
         A56PedidoFHInicio = (DateTime)(DateTime.MinValue);
         lblTextblockmesaid_Jsonclick = "";
         lblTextblockpedidotipo_Jsonclick = "";
         A57PedidoTipo = "";
         Gridpedido_lineaContainer = new GXWebGrid( context);
         Gridpedido_lineaColumn = new GXWebColumn();
         A46PedidoLineaComentarios = "";
         A47PedidoLineaEstado = "";
         A48PedidoLineaFHInicio = (DateTime)(DateTime.MinValue);
         A49PedidoLineaFHFin = (DateTime)(DateTime.MinValue);
         Gx_mode = "";
         sMode2 = "";
         edtPedidoLineaId_Internalname = "";
         lblTextblockimportetotal_Jsonclick = "";
         lblTitlelinea_Jsonclick = "";
         imgBtn_first_Jsonclick = "";
         imgBtn_first_separator_Jsonclick = "";
         imgBtn_previous_Jsonclick = "";
         imgBtn_previous_separator_Jsonclick = "";
         imgBtn_next_Jsonclick = "";
         imgBtn_next_separator_Jsonclick = "";
         imgBtn_last_Jsonclick = "";
         imgBtn_last_separator_Jsonclick = "";
         imgBtn_select_Jsonclick = "";
         imgBtn_select_separator_Jsonclick = "";
         imgBtn_enter2_Jsonclick = "";
         imgBtn_enter2_separator_Jsonclick = "";
         imgBtn_cancel2_Jsonclick = "";
         imgBtn_cancel2_separator_Jsonclick = "";
         imgBtn_delete2_Jsonclick = "";
         imgBtn_delete2_separator_Jsonclick = "";
         Z54PedidoEstado = "";
         Z55PedidoFHFin = (DateTime)(DateTime.MinValue);
         Z56PedidoFHInicio = (DateTime)(DateTime.MinValue);
         Z57PedidoTipo = "";
         sEvt = "";
         EvtGridId = "";
         EvtRowId = "";
         sEvtType = "";
         edtPedidoLineaCantidad_Internalname = "";
         edtPedidoLineaComentarios_Internalname = "";
         edtPedidoLineaEstado_Internalname = "";
         edtPedidoLineaFHInicio_Internalname = "";
         edtPedidoLineaFHFin_Internalname = "";
         edtPedidoLineaPrioridad_Internalname = "";
         edtProductoId_Internalname = "";
         edtProductoPrecio_Internalname = "";
         edtLineaImporte_Internalname = "";
         Z46PedidoLineaComentarios = "";
         Z47PedidoLineaEstado = "";
         Z48PedidoLineaFHInicio = (DateTime)(DateTime.MinValue);
         Z49PedidoLineaFHFin = (DateTime)(DateTime.MinValue);
         T000117_A1PedidoId = new long[1] ;
         T000117_A53PedidoCantidadPersonas = new short[1] ;
         T000117_A54PedidoEstado = new String[] {""} ;
         T000117_A55PedidoFHFin = new DateTime[] {DateTime.MinValue} ;
         T000117_A56PedidoFHInicio = new DateTime[] {DateTime.MinValue} ;
         T000117_A57PedidoTipo = new String[] {""} ;
         T000117_A6MesaId = new long[1] ;
         T000117_A8ImporteTotal = new decimal[1] ;
         T000117_n8ImporteTotal = new bool[] {false} ;
         T000113_A8ImporteTotal = new decimal[1] ;
         T000113_n8ImporteTotal = new bool[] {false} ;
         T00019_A6MesaId = new long[1] ;
         T000121_A8ImporteTotal = new decimal[1] ;
         T000121_n8ImporteTotal = new bool[] {false} ;
         T000122_A6MesaId = new long[1] ;
         T000123_A1PedidoId = new long[1] ;
         T00018_A1PedidoId = new long[1] ;
         T00018_A53PedidoCantidadPersonas = new short[1] ;
         T00018_A54PedidoEstado = new String[] {""} ;
         T00018_A55PedidoFHFin = new DateTime[] {DateTime.MinValue} ;
         T00018_A56PedidoFHInicio = new DateTime[] {DateTime.MinValue} ;
         T00018_A57PedidoTipo = new String[] {""} ;
         T00018_A6MesaId = new long[1] ;
         sMode1 = "";
         T000124_A1PedidoId = new long[1] ;
         T000125_A1PedidoId = new long[1] ;
         T000126_A1PedidoId = new long[1] ;
         T000126_A53PedidoCantidadPersonas = new short[1] ;
         T000126_A54PedidoEstado = new String[] {""} ;
         T000126_A55PedidoFHFin = new DateTime[] {DateTime.MinValue} ;
         T000126_A56PedidoFHInicio = new DateTime[] {DateTime.MinValue} ;
         T000126_A57PedidoTipo = new String[] {""} ;
         T000126_A6MesaId = new long[1] ;
         T000133_A8ImporteTotal = new decimal[1] ;
         T000133_n8ImporteTotal = new bool[] {false} ;
         T000134_A1PedidoId = new long[1] ;
         T000136_A1PedidoId = new long[1] ;
         T000136_A9PedidoLineaId = new long[1] ;
         T000136_A45PedidoLineaCantidad = new short[1] ;
         T000136_A46PedidoLineaComentarios = new String[] {""} ;
         T000136_A47PedidoLineaEstado = new String[] {""} ;
         T000136_A48PedidoLineaFHInicio = new DateTime[] {DateTime.MinValue} ;
         T000136_A49PedidoLineaFHFin = new DateTime[] {DateTime.MinValue} ;
         T000136_A50PedidoLineaPrioridad = new short[1] ;
         T000136_A16ProductoId = new long[1] ;
         T000136_n16ProductoId = new bool[] {false} ;
         T000136_A22ProductoPrecio = new decimal[1] ;
         T000136_n22ProductoPrecio = new bool[] {false} ;
         T00014_A16ProductoId = new long[1] ;
         T00014_n16ProductoId = new bool[] {false} ;
         T00016_A22ProductoPrecio = new decimal[1] ;
         T00016_n22ProductoPrecio = new bool[] {false} ;
         T000137_A16ProductoId = new long[1] ;
         T000137_n16ProductoId = new bool[] {false} ;
         T000139_A22ProductoPrecio = new decimal[1] ;
         T000139_n22ProductoPrecio = new bool[] {false} ;
         T000140_A1PedidoId = new long[1] ;
         T000140_A9PedidoLineaId = new long[1] ;
         T00013_A1PedidoId = new long[1] ;
         T00013_A9PedidoLineaId = new long[1] ;
         T00013_A45PedidoLineaCantidad = new short[1] ;
         T00013_A46PedidoLineaComentarios = new String[] {""} ;
         T00013_A47PedidoLineaEstado = new String[] {""} ;
         T00013_A48PedidoLineaFHInicio = new DateTime[] {DateTime.MinValue} ;
         T00013_A49PedidoLineaFHFin = new DateTime[] {DateTime.MinValue} ;
         T00013_A50PedidoLineaPrioridad = new short[1] ;
         T00013_A16ProductoId = new long[1] ;
         T00013_n16ProductoId = new bool[] {false} ;
         T00012_A1PedidoId = new long[1] ;
         T00012_A9PedidoLineaId = new long[1] ;
         T00012_A45PedidoLineaCantidad = new short[1] ;
         T00012_A46PedidoLineaComentarios = new String[] {""} ;
         T00012_A47PedidoLineaEstado = new String[] {""} ;
         T00012_A48PedidoLineaFHInicio = new DateTime[] {DateTime.MinValue} ;
         T00012_A49PedidoLineaFHFin = new DateTime[] {DateTime.MinValue} ;
         T00012_A50PedidoLineaPrioridad = new short[1] ;
         T00012_A16ProductoId = new long[1] ;
         T00012_n16ProductoId = new bool[] {false} ;
         T000145_A22ProductoPrecio = new decimal[1] ;
         T000145_n22ProductoPrecio = new bool[] {false} ;
         T000146_A1PedidoId = new long[1] ;
         T000146_A9PedidoLineaId = new long[1] ;
         imgprompt_16_Internalname = "";
         Gridpedido_lineaRow = new GXWebRow();
         subGridpedido_linea_Linesclass = "";
         ROClassString = "";
         GXCCtl = "";
         sDynURL = "";
         FormProcess = "";
         isValidOutput = new GxUnknownObjectCollection();
         T000147_A6MesaId = new long[1] ;
         T000148_A16ProductoId = new long[1] ;
         T000148_n16ProductoId = new bool[] {false} ;
         pr_default = new DataStoreProvider(context, new GeneXus.Programs.pedido__default(),
            new Object[][] {
                new Object[] {
               T00012_A1PedidoId, T00012_A9PedidoLineaId, T00012_A45PedidoLineaCantidad, T00012_A46PedidoLineaComentarios, T00012_A47PedidoLineaEstado, T00012_A48PedidoLineaFHInicio, T00012_A49PedidoLineaFHFin, T00012_A50PedidoLineaPrioridad, T00012_A16ProductoId
               }
               , new Object[] {
               T00013_A1PedidoId, T00013_A9PedidoLineaId, T00013_A45PedidoLineaCantidad, T00013_A46PedidoLineaComentarios, T00013_A47PedidoLineaEstado, T00013_A48PedidoLineaFHInicio, T00013_A49PedidoLineaFHFin, T00013_A50PedidoLineaPrioridad, T00013_A16ProductoId
               }
               , new Object[] {
               T00014_A16ProductoId
               }
               , new Object[] {
               T00016_A22ProductoPrecio, T00016_n22ProductoPrecio
               }
               , new Object[] {
               T00017_A1PedidoId, T00017_A53PedidoCantidadPersonas, T00017_A54PedidoEstado, T00017_A55PedidoFHFin, T00017_A56PedidoFHInicio, T00017_A57PedidoTipo, T00017_A6MesaId
               }
               , new Object[] {
               T00018_A1PedidoId, T00018_A53PedidoCantidadPersonas, T00018_A54PedidoEstado, T00018_A55PedidoFHFin, T00018_A56PedidoFHInicio, T00018_A57PedidoTipo, T00018_A6MesaId
               }
               , new Object[] {
               T00019_A6MesaId
               }
               , new Object[] {
               T000113_A8ImporteTotal, T000113_n8ImporteTotal
               }
               , new Object[] {
               T000117_A1PedidoId, T000117_A53PedidoCantidadPersonas, T000117_A54PedidoEstado, T000117_A55PedidoFHFin, T000117_A56PedidoFHInicio, T000117_A57PedidoTipo, T000117_A6MesaId, T000117_A8ImporteTotal, T000117_n8ImporteTotal
               }
               , new Object[] {
               T000121_A8ImporteTotal, T000121_n8ImporteTotal
               }
               , new Object[] {
               T000122_A6MesaId
               }
               , new Object[] {
               T000123_A1PedidoId
               }
               , new Object[] {
               T000124_A1PedidoId
               }
               , new Object[] {
               T000125_A1PedidoId
               }
               , new Object[] {
               T000126_A1PedidoId, T000126_A53PedidoCantidadPersonas, T000126_A54PedidoEstado, T000126_A55PedidoFHFin, T000126_A56PedidoFHInicio, T000126_A57PedidoTipo, T000126_A6MesaId
               }
               , new Object[] {
               }
               , new Object[] {
               }
               , new Object[] {
               }
               , new Object[] {
               T000133_A8ImporteTotal, T000133_n8ImporteTotal
               }
               , new Object[] {
               T000134_A1PedidoId
               }
               , new Object[] {
               T000136_A1PedidoId, T000136_A9PedidoLineaId, T000136_A45PedidoLineaCantidad, T000136_A46PedidoLineaComentarios, T000136_A47PedidoLineaEstado, T000136_A48PedidoLineaFHInicio, T000136_A49PedidoLineaFHFin, T000136_A50PedidoLineaPrioridad, T000136_A16ProductoId, T000136_n16ProductoId,
               T000136_A22ProductoPrecio, T000136_n22ProductoPrecio
               }
               , new Object[] {
               T000137_A16ProductoId
               }
               , new Object[] {
               T000139_A22ProductoPrecio, T000139_n22ProductoPrecio
               }
               , new Object[] {
               T000140_A1PedidoId, T000140_A9PedidoLineaId
               }
               , new Object[] {
               }
               , new Object[] {
               }
               , new Object[] {
               }
               , new Object[] {
               T000145_A22ProductoPrecio, T000145_n22ProductoPrecio
               }
               , new Object[] {
               T000146_A1PedidoId, T000146_A9PedidoLineaId
               }
               , new Object[] {
               T000147_A6MesaId
               }
               , new Object[] {
               T000148_A16ProductoId
               }
            }
         );
      }

      private short nIsMod_2 ;
      private short GxWebError ;
      private short nRC_Gridpedido_linea ;
      private short nGXsfl_76_idx=1 ;
      private short gxcookieaux ;
      private short IsConfirmed ;
      private short IsModified ;
      private short AnyError ;
      private short nKeyPressed ;
      private short initialized ;
      private short A53PedidoCantidadPersonas ;
      private short subGridpedido_linea_Backcolorstyle ;
      private short A45PedidoLineaCantidad ;
      private short A50PedidoLineaPrioridad ;
      private short subGridpedido_linea_Allowselection ;
      private short subGridpedido_linea_Allowhovering ;
      private short subGridpedido_linea_Allowcollapsing ;
      private short subGridpedido_linea_Collapsed ;
      private short nBlankRcdCount2 ;
      private short nRcdExists_2 ;
      private short RcdFound2 ;
      private short nBlankRcdUsr2 ;
      private short Z53PedidoCantidadPersonas ;
      private short nRcdDeleted_2 ;
      private short Z45PedidoLineaCantidad ;
      private short Z50PedidoLineaPrioridad ;
      private short GX_JID ;
      private short RcdFound1 ;
      private short Gx_BScreen ;
      private short subGridpedido_linea_Backstyle ;
      private short gxajaxcallmode ;
      private short wbTemp ;
      private int trnEnded ;
      private int bttBtn_enter_Visible ;
      private int bttBtn_cancel_Visible ;
      private int bttBtn_delete_Visible ;
      private int edtPedidoId_Enabled ;
      private int edtPedidoCantidadPersonas_Enabled ;
      private int edtPedidoEstado_Enabled ;
      private int edtPedidoFHFin_Enabled ;
      private int edtPedidoFHInicio_Enabled ;
      private int edtMesaId_Enabled ;
      private int imgprompt_6_Visible ;
      private int edtPedidoTipo_Enabled ;
      private int edtPedidoLineaId_Enabled ;
      private int edtPedidoLineaCantidad_Enabled ;
      private int edtPedidoLineaComentarios_Enabled ;
      private int edtPedidoLineaEstado_Enabled ;
      private int edtPedidoLineaFHInicio_Enabled ;
      private int edtPedidoLineaFHFin_Enabled ;
      private int edtPedidoLineaPrioridad_Enabled ;
      private int edtProductoId_Enabled ;
      private int edtProductoPrecio_Enabled ;
      private int edtLineaImporte_Enabled ;
      private int subGridpedido_linea_Selectioncolor ;
      private int subGridpedido_linea_Hoveringcolor ;
      private int fRowAdded ;
      private int edtImporteTotal_Enabled ;
      private int imgBtn_first_Visible ;
      private int imgBtn_first_separator_Visible ;
      private int imgBtn_previous_Visible ;
      private int imgBtn_previous_separator_Visible ;
      private int imgBtn_next_Visible ;
      private int imgBtn_next_separator_Visible ;
      private int imgBtn_last_Visible ;
      private int imgBtn_last_separator_Visible ;
      private int imgBtn_select_Visible ;
      private int imgBtn_select_separator_Visible ;
      private int imgBtn_enter2_Visible ;
      private int imgBtn_enter2_Enabled ;
      private int imgBtn_enter2_separator_Visible ;
      private int imgBtn_cancel2_Visible ;
      private int imgBtn_cancel2_separator_Visible ;
      private int imgBtn_delete2_Visible ;
      private int imgBtn_delete2_Enabled ;
      private int imgBtn_delete2_separator_Visible ;
      private int GRIDPEDIDO_LINEA_nFirstRecordOnPage ;
      private int subGridpedido_linea_Backcolor ;
      private int subGridpedido_linea_Allbackcolor ;
      private int imgprompt_16_Visible ;
      private int defedtPedidoLineaId_Enabled ;
      private int idxLst ;
      private long A1PedidoId ;
      private long A6MesaId ;
      private long A16ProductoId ;
      private long A9PedidoLineaId ;
      private long Z1PedidoId ;
      private long Z6MesaId ;
      private long Z9PedidoLineaId ;
      private long Z16ProductoId ;
      private decimal A22ProductoPrecio ;
      private decimal A17LineaImporte ;
      private decimal B8ImporteTotal ;
      private decimal A8ImporteTotal ;
      private decimal O8ImporteTotal ;
      private decimal s8ImporteTotal ;
      private decimal T17LineaImporte ;
      private decimal O17LineaImporte ;
      private decimal Z8ImporteTotal ;
      private decimal Z22ProductoPrecio ;
      private String sPrefix ;
      private String sGXsfl_76_idx="0001" ;
      private String scmdbuf ;
      private String gxfirstwebparm ;
      private String gxfirstwebparm_bkp ;
      private String GXKey ;
      private String PreviousTooltip ;
      private String PreviousCaption ;
      private String GX_FocusControl ;
      private String edtPedidoId_Internalname ;
      private String sStyleString ;
      private String tblTablemain_Internalname ;
      private String ClassString ;
      private String StyleString ;
      private String grpGroupdata_Internalname ;
      private String tblTable1_Internalname ;
      private String TempTags ;
      private String bttBtn_enter_Internalname ;
      private String bttBtn_enter_Jsonclick ;
      private String bttBtn_cancel_Internalname ;
      private String bttBtn_cancel_Jsonclick ;
      private String bttBtn_delete_Internalname ;
      private String bttBtn_delete_Jsonclick ;
      private String tblTable2_Internalname ;
      private String lblTextblockpedidoid_Internalname ;
      private String lblTextblockpedidoid_Jsonclick ;
      private String edtPedidoId_Jsonclick ;
      private String lblTextblockpedidocantidadpersonas_Internalname ;
      private String lblTextblockpedidocantidadpersonas_Jsonclick ;
      private String edtPedidoCantidadPersonas_Internalname ;
      private String edtPedidoCantidadPersonas_Jsonclick ;
      private String lblTextblockpedidoestado_Internalname ;
      private String lblTextblockpedidoestado_Jsonclick ;
      private String edtPedidoEstado_Internalname ;
      private String A54PedidoEstado ;
      private String edtPedidoEstado_Jsonclick ;
      private String lblTextblockpedidofhfin_Internalname ;
      private String lblTextblockpedidofhfin_Jsonclick ;
      private String edtPedidoFHFin_Internalname ;
      private String edtPedidoFHFin_Jsonclick ;
      private String lblTextblockpedidofhinicio_Internalname ;
      private String lblTextblockpedidofhinicio_Jsonclick ;
      private String edtPedidoFHInicio_Internalname ;
      private String edtPedidoFHInicio_Jsonclick ;
      private String lblTextblockmesaid_Internalname ;
      private String lblTextblockmesaid_Jsonclick ;
      private String edtMesaId_Internalname ;
      private String edtMesaId_Jsonclick ;
      private String imgprompt_6_Internalname ;
      private String imgprompt_6_Link ;
      private String lblTextblockpedidotipo_Internalname ;
      private String lblTextblockpedidotipo_Jsonclick ;
      private String edtPedidoTipo_Internalname ;
      private String A57PedidoTipo ;
      private String edtPedidoTipo_Jsonclick ;
      private String A47PedidoLineaEstado ;
      private String Gx_mode ;
      private String sMode2 ;
      private String edtPedidoLineaId_Internalname ;
      private String lblTextblockimportetotal_Internalname ;
      private String lblTextblockimportetotal_Jsonclick ;
      private String edtImporteTotal_Internalname ;
      private String edtImporteTotal_Jsonclick ;
      private String tblTable3_Internalname ;
      private String lblTitlelinea_Internalname ;
      private String lblTitlelinea_Jsonclick ;
      private String tblTabletoolbar_Internalname ;
      private String divSectiontoolbar_Internalname ;
      private String imgBtn_first_Internalname ;
      private String imgBtn_first_Jsonclick ;
      private String imgBtn_first_separator_Internalname ;
      private String imgBtn_first_separator_Jsonclick ;
      private String imgBtn_previous_Internalname ;
      private String imgBtn_previous_Jsonclick ;
      private String imgBtn_previous_separator_Internalname ;
      private String imgBtn_previous_separator_Jsonclick ;
      private String imgBtn_next_Internalname ;
      private String imgBtn_next_Jsonclick ;
      private String imgBtn_next_separator_Internalname ;
      private String imgBtn_next_separator_Jsonclick ;
      private String imgBtn_last_Internalname ;
      private String imgBtn_last_Jsonclick ;
      private String imgBtn_last_separator_Internalname ;
      private String imgBtn_last_separator_Jsonclick ;
      private String imgBtn_select_Internalname ;
      private String imgBtn_select_Jsonclick ;
      private String imgBtn_select_separator_Internalname ;
      private String imgBtn_select_separator_Jsonclick ;
      private String imgBtn_enter2_Internalname ;
      private String imgBtn_enter2_Jsonclick ;
      private String imgBtn_enter2_separator_Internalname ;
      private String imgBtn_enter2_separator_Jsonclick ;
      private String imgBtn_cancel2_Internalname ;
      private String imgBtn_cancel2_Jsonclick ;
      private String imgBtn_cancel2_separator_Internalname ;
      private String imgBtn_cancel2_separator_Jsonclick ;
      private String imgBtn_delete2_Internalname ;
      private String imgBtn_delete2_Jsonclick ;
      private String imgBtn_delete2_separator_Internalname ;
      private String imgBtn_delete2_separator_Jsonclick ;
      private String Z54PedidoEstado ;
      private String Z57PedidoTipo ;
      private String sEvt ;
      private String EvtGridId ;
      private String EvtRowId ;
      private String sEvtType ;
      private String edtPedidoLineaCantidad_Internalname ;
      private String edtPedidoLineaComentarios_Internalname ;
      private String edtPedidoLineaEstado_Internalname ;
      private String edtPedidoLineaFHInicio_Internalname ;
      private String edtPedidoLineaFHFin_Internalname ;
      private String edtPedidoLineaPrioridad_Internalname ;
      private String edtProductoId_Internalname ;
      private String edtProductoPrecio_Internalname ;
      private String edtLineaImporte_Internalname ;
      private String Z47PedidoLineaEstado ;
      private String sMode1 ;
      private String imgprompt_16_Internalname ;
      private String subGridpedido_linea_Class ;
      private String subGridpedido_linea_Linesclass ;
      private String imgprompt_16_Link ;
      private String ROClassString ;
      private String edtPedidoLineaId_Jsonclick ;
      private String edtPedidoLineaCantidad_Jsonclick ;
      private String edtPedidoLineaComentarios_Jsonclick ;
      private String edtPedidoLineaEstado_Jsonclick ;
      private String edtPedidoLineaFHInicio_Jsonclick ;
      private String edtPedidoLineaFHFin_Jsonclick ;
      private String edtPedidoLineaPrioridad_Jsonclick ;
      private String edtProductoId_Jsonclick ;
      private String edtProductoPrecio_Jsonclick ;
      private String edtLineaImporte_Jsonclick ;
      private String GXCCtl ;
      private String sDynURL ;
      private String FormProcess ;
      private String subGridpedido_linea_Internalname ;
      private DateTime A55PedidoFHFin ;
      private DateTime A56PedidoFHInicio ;
      private DateTime A48PedidoLineaFHInicio ;
      private DateTime A49PedidoLineaFHFin ;
      private DateTime Z55PedidoFHFin ;
      private DateTime Z56PedidoFHInicio ;
      private DateTime Z48PedidoLineaFHInicio ;
      private DateTime Z49PedidoLineaFHFin ;
      private bool entryPointCalled ;
      private bool n16ProductoId ;
      private bool wbErr ;
      private bool n8ImporteTotal ;
      private bool Gx_longc ;
      private bool n22ProductoPrecio ;
      private bool n17LineaImporte ;
      private String A46PedidoLineaComentarios ;
      private String Z46PedidoLineaComentarios ;
      private GxUnknownObjectCollection isValidOutput ;
      private GXMasterPage MasterPageObj ;
      private GXWebGrid Gridpedido_lineaContainer ;
      private GXWebRow Gridpedido_lineaRow ;
      private GXWebColumn Gridpedido_lineaColumn ;
      private IGxDataStore dsDefault ;
      private IDataStoreProvider pr_default ;
      private long[] T000117_A1PedidoId ;
      private short[] T000117_A53PedidoCantidadPersonas ;
      private String[] T000117_A54PedidoEstado ;
      private DateTime[] T000117_A55PedidoFHFin ;
      private DateTime[] T000117_A56PedidoFHInicio ;
      private String[] T000117_A57PedidoTipo ;
      private long[] T000117_A6MesaId ;
      private decimal[] T000117_A8ImporteTotal ;
      private bool[] T000117_n8ImporteTotal ;
      private decimal[] T000113_A8ImporteTotal ;
      private bool[] T000113_n8ImporteTotal ;
      private long[] T00019_A6MesaId ;
      private decimal[] T000121_A8ImporteTotal ;
      private bool[] T000121_n8ImporteTotal ;
      private long[] T000122_A6MesaId ;
      private long[] T000123_A1PedidoId ;
      private long[] T00018_A1PedidoId ;
      private short[] T00018_A53PedidoCantidadPersonas ;
      private String[] T00018_A54PedidoEstado ;
      private DateTime[] T00018_A55PedidoFHFin ;
      private DateTime[] T00018_A56PedidoFHInicio ;
      private String[] T00018_A57PedidoTipo ;
      private long[] T00018_A6MesaId ;
      private long[] T000124_A1PedidoId ;
      private long[] T000125_A1PedidoId ;
      private long[] T000126_A1PedidoId ;
      private short[] T000126_A53PedidoCantidadPersonas ;
      private String[] T000126_A54PedidoEstado ;
      private DateTime[] T000126_A55PedidoFHFin ;
      private DateTime[] T000126_A56PedidoFHInicio ;
      private String[] T000126_A57PedidoTipo ;
      private long[] T000126_A6MesaId ;
      private decimal[] T000133_A8ImporteTotal ;
      private bool[] T000133_n8ImporteTotal ;
      private long[] T000134_A1PedidoId ;
      private long[] T000136_A1PedidoId ;
      private long[] T000136_A9PedidoLineaId ;
      private short[] T000136_A45PedidoLineaCantidad ;
      private String[] T000136_A46PedidoLineaComentarios ;
      private String[] T000136_A47PedidoLineaEstado ;
      private DateTime[] T000136_A48PedidoLineaFHInicio ;
      private DateTime[] T000136_A49PedidoLineaFHFin ;
      private short[] T000136_A50PedidoLineaPrioridad ;
      private long[] T000136_A16ProductoId ;
      private bool[] T000136_n16ProductoId ;
      private decimal[] T000136_A22ProductoPrecio ;
      private bool[] T000136_n22ProductoPrecio ;
      private long[] T00014_A16ProductoId ;
      private bool[] T00014_n16ProductoId ;
      private decimal[] T00016_A22ProductoPrecio ;
      private bool[] T00016_n22ProductoPrecio ;
      private long[] T000137_A16ProductoId ;
      private bool[] T000137_n16ProductoId ;
      private decimal[] T000139_A22ProductoPrecio ;
      private bool[] T000139_n22ProductoPrecio ;
      private long[] T000140_A1PedidoId ;
      private long[] T000140_A9PedidoLineaId ;
      private long[] T00013_A1PedidoId ;
      private long[] T00013_A9PedidoLineaId ;
      private short[] T00013_A45PedidoLineaCantidad ;
      private String[] T00013_A46PedidoLineaComentarios ;
      private String[] T00013_A47PedidoLineaEstado ;
      private DateTime[] T00013_A48PedidoLineaFHInicio ;
      private DateTime[] T00013_A49PedidoLineaFHFin ;
      private short[] T00013_A50PedidoLineaPrioridad ;
      private long[] T00013_A16ProductoId ;
      private bool[] T00013_n16ProductoId ;
      private long[] T00012_A1PedidoId ;
      private long[] T00012_A9PedidoLineaId ;
      private short[] T00012_A45PedidoLineaCantidad ;
      private String[] T00012_A46PedidoLineaComentarios ;
      private String[] T00012_A47PedidoLineaEstado ;
      private DateTime[] T00012_A48PedidoLineaFHInicio ;
      private DateTime[] T00012_A49PedidoLineaFHFin ;
      private short[] T00012_A50PedidoLineaPrioridad ;
      private long[] T00012_A16ProductoId ;
      private bool[] T00012_n16ProductoId ;
      private decimal[] T000145_A22ProductoPrecio ;
      private bool[] T000145_n22ProductoPrecio ;
      private long[] T000146_A1PedidoId ;
      private long[] T000146_A9PedidoLineaId ;
      private long[] T000147_A6MesaId ;
      private long[] T000148_A16ProductoId ;
      private bool[] T000148_n16ProductoId ;
      private long[] T00017_A1PedidoId ;
      private short[] T00017_A53PedidoCantidadPersonas ;
      private String[] T00017_A54PedidoEstado ;
      private DateTime[] T00017_A55PedidoFHFin ;
      private DateTime[] T00017_A56PedidoFHInicio ;
      private String[] T00017_A57PedidoTipo ;
      private long[] T00017_A6MesaId ;
      private GXWebForm Form ;
   }

   public class pedido__default : DataStoreHelperBase, IDataStoreHelper
   {
      public ICursor[] getCursors( )
      {
         cursorDefinitions();
         return new Cursor[] {
          new ForEachCursor(def[0])
         ,new ForEachCursor(def[1])
         ,new ForEachCursor(def[2])
         ,new ForEachCursor(def[3])
         ,new ForEachCursor(def[4])
         ,new ForEachCursor(def[5])
         ,new ForEachCursor(def[6])
         ,new ForEachCursor(def[7])
         ,new ForEachCursor(def[8])
         ,new ForEachCursor(def[9])
         ,new ForEachCursor(def[10])
         ,new ForEachCursor(def[11])
         ,new ForEachCursor(def[12])
         ,new ForEachCursor(def[13])
         ,new ForEachCursor(def[14])
         ,new UpdateCursor(def[15])
         ,new UpdateCursor(def[16])
         ,new UpdateCursor(def[17])
         ,new ForEachCursor(def[18])
         ,new ForEachCursor(def[19])
         ,new ForEachCursor(def[20])
         ,new ForEachCursor(def[21])
         ,new ForEachCursor(def[22])
         ,new ForEachCursor(def[23])
         ,new UpdateCursor(def[24])
         ,new UpdateCursor(def[25])
         ,new UpdateCursor(def[26])
         ,new ForEachCursor(def[27])
         ,new ForEachCursor(def[28])
         ,new ForEachCursor(def[29])
         ,new ForEachCursor(def[30])
       };
    }

    private static CursorDef[] def;
    private void cursorDefinitions( )
    {
       if ( def == null )
       {
          Object[] prmT00017 ;
          prmT00017 = new Object[] {
          new Object[] {"@PedidoId",SqlDbType.Decimal,10,0}
          } ;
          Object[] prmT000117 ;
          prmT000117 = new Object[] {
          new Object[] {"@PedidoId",SqlDbType.Decimal,10,0}
          } ;
          Object[] prmT000113 ;
          prmT000113 = new Object[] {
          new Object[] {"@PedidoId",SqlDbType.Decimal,10,0}
          } ;
          Object[] prmT00019 ;
          prmT00019 = new Object[] {
          new Object[] {"@MesaId",SqlDbType.Decimal,10,0}
          } ;
          Object[] prmT000121 ;
          prmT000121 = new Object[] {
          new Object[] {"@PedidoId",SqlDbType.Decimal,10,0}
          } ;
          Object[] prmT000122 ;
          prmT000122 = new Object[] {
          new Object[] {"@MesaId",SqlDbType.Decimal,10,0}
          } ;
          Object[] prmT000123 ;
          prmT000123 = new Object[] {
          new Object[] {"@PedidoId",SqlDbType.Decimal,10,0}
          } ;
          Object[] prmT00018 ;
          prmT00018 = new Object[] {
          new Object[] {"@PedidoId",SqlDbType.Decimal,10,0}
          } ;
          Object[] prmT000124 ;
          prmT000124 = new Object[] {
          new Object[] {"@PedidoId",SqlDbType.Decimal,10,0}
          } ;
          Object[] prmT000125 ;
          prmT000125 = new Object[] {
          new Object[] {"@PedidoId",SqlDbType.Decimal,10,0}
          } ;
          Object[] prmT000126 ;
          prmT000126 = new Object[] {
          new Object[] {"@PedidoId",SqlDbType.Decimal,10,0}
          } ;
          Object[] prmT000127 ;
          prmT000127 = new Object[] {
          new Object[] {"@PedidoId",SqlDbType.Decimal,10,0} ,
          new Object[] {"@PedidoCantidadPersonas",SqlDbType.SmallInt,4,0} ,
          new Object[] {"@PedidoEstado",SqlDbType.Char,1,0} ,
          new Object[] {"@PedidoFHFin",SqlDbType.DateTime,8,5} ,
          new Object[] {"@PedidoFHInicio",SqlDbType.DateTime,8,5} ,
          new Object[] {"@PedidoTipo",SqlDbType.Char,20,0} ,
          new Object[] {"@MesaId",SqlDbType.Decimal,10,0}
          } ;
          Object[] prmT000128 ;
          prmT000128 = new Object[] {
          new Object[] {"@PedidoCantidadPersonas",SqlDbType.SmallInt,4,0} ,
          new Object[] {"@PedidoEstado",SqlDbType.Char,1,0} ,
          new Object[] {"@PedidoFHFin",SqlDbType.DateTime,8,5} ,
          new Object[] {"@PedidoFHInicio",SqlDbType.DateTime,8,5} ,
          new Object[] {"@PedidoTipo",SqlDbType.Char,20,0} ,
          new Object[] {"@MesaId",SqlDbType.Decimal,10,0} ,
          new Object[] {"@PedidoId",SqlDbType.Decimal,10,0}
          } ;
          Object[] prmT000129 ;
          prmT000129 = new Object[] {
          new Object[] {"@PedidoId",SqlDbType.Decimal,10,0}
          } ;
          Object[] prmT000134 ;
          prmT000134 = new Object[] {
          } ;
          Object[] prmT000136 ;
          prmT000136 = new Object[] {
          new Object[] {"@PedidoId",SqlDbType.Decimal,10,0} ,
          new Object[] {"@PedidoLineaId",SqlDbType.Decimal,10,0}
          } ;
          Object[] prmT00014 ;
          prmT00014 = new Object[] {
          new Object[] {"@ProductoId",SqlDbType.Decimal,10,0}
          } ;
          Object[] prmT00016 ;
          prmT00016 = new Object[] {
          new Object[] {"@ProductoId",SqlDbType.Decimal,10,0}
          } ;
          Object[] prmT000137 ;
          prmT000137 = new Object[] {
          new Object[] {"@ProductoId",SqlDbType.Decimal,10,0}
          } ;
          Object[] prmT000139 ;
          prmT000139 = new Object[] {
          new Object[] {"@ProductoId",SqlDbType.Decimal,10,0}
          } ;
          Object[] prmT000140 ;
          prmT000140 = new Object[] {
          new Object[] {"@PedidoId",SqlDbType.Decimal,10,0} ,
          new Object[] {"@PedidoLineaId",SqlDbType.Decimal,10,0}
          } ;
          Object[] prmT00013 ;
          prmT00013 = new Object[] {
          new Object[] {"@PedidoId",SqlDbType.Decimal,10,0} ,
          new Object[] {"@PedidoLineaId",SqlDbType.Decimal,10,0}
          } ;
          Object[] prmT00012 ;
          prmT00012 = new Object[] {
          new Object[] {"@PedidoId",SqlDbType.Decimal,10,0} ,
          new Object[] {"@PedidoLineaId",SqlDbType.Decimal,10,0}
          } ;
          Object[] prmT000141 ;
          prmT000141 = new Object[] {
          new Object[] {"@PedidoId",SqlDbType.Decimal,10,0} ,
          new Object[] {"@PedidoLineaId",SqlDbType.Decimal,10,0} ,
          new Object[] {"@PedidoLineaCantidad",SqlDbType.SmallInt,3,0} ,
          new Object[] {"@PedidoLineaComentarios",SqlDbType.VarChar,200,0} ,
          new Object[] {"@PedidoLineaEstado",SqlDbType.Char,1,0} ,
          new Object[] {"@PedidoLineaFHInicio",SqlDbType.DateTime,8,5} ,
          new Object[] {"@PedidoLineaFHFin",SqlDbType.DateTime,8,5} ,
          new Object[] {"@PedidoLineaPrioridad",SqlDbType.SmallInt,4,0} ,
          new Object[] {"@ProductoId",SqlDbType.Decimal,10,0}
          } ;
          Object[] prmT000142 ;
          prmT000142 = new Object[] {
          new Object[] {"@PedidoLineaCantidad",SqlDbType.SmallInt,3,0} ,
          new Object[] {"@PedidoLineaComentarios",SqlDbType.VarChar,200,0} ,
          new Object[] {"@PedidoLineaEstado",SqlDbType.Char,1,0} ,
          new Object[] {"@PedidoLineaFHInicio",SqlDbType.DateTime,8,5} ,
          new Object[] {"@PedidoLineaFHFin",SqlDbType.DateTime,8,5} ,
          new Object[] {"@PedidoLineaPrioridad",SqlDbType.SmallInt,4,0} ,
          new Object[] {"@ProductoId",SqlDbType.Decimal,10,0} ,
          new Object[] {"@PedidoId",SqlDbType.Decimal,10,0} ,
          new Object[] {"@PedidoLineaId",SqlDbType.Decimal,10,0}
          } ;
          Object[] prmT000143 ;
          prmT000143 = new Object[] {
          new Object[] {"@PedidoId",SqlDbType.Decimal,10,0} ,
          new Object[] {"@PedidoLineaId",SqlDbType.Decimal,10,0}
          } ;
          Object[] prmT000146 ;
          prmT000146 = new Object[] {
          new Object[] {"@PedidoId",SqlDbType.Decimal,10,0}
          } ;
          Object[] prmT000133 ;
          prmT000133 = new Object[] {
          new Object[] {"@PedidoId",SqlDbType.Decimal,10,0}
          } ;
          Object[] prmT000147 ;
          prmT000147 = new Object[] {
          new Object[] {"@MesaId",SqlDbType.Decimal,10,0}
          } ;
          Object[] prmT000148 ;
          prmT000148 = new Object[] {
          new Object[] {"@ProductoId",SqlDbType.Decimal,10,0}
          } ;
          Object[] prmT000145 ;
          prmT000145 = new Object[] {
          new Object[] {"@ProductoId",SqlDbType.Decimal,10,0}
          } ;
          def= new CursorDef[] {
              new CursorDef("T00012", "SELECT [PedidoId], [PedidoLineaId], [PedidoLineaCantidad], [PedidoLineaComentarios], [PedidoLineaEstado], [PedidoLineaFHInicio], [PedidoLineaFHFin], [PedidoLineaPrioridad], [ProductoId] FROM [PedidoLinea] WITH (UPDLOCK) WHERE [PedidoId] = @PedidoId AND [PedidoLineaId] = @PedidoLineaId ",true, GxErrorMask.GX_NOMASK, false, this,prmT00012,1,0,true,false )
             ,new CursorDef("T00013", "SELECT [PedidoId], [PedidoLineaId], [PedidoLineaCantidad], [PedidoLineaComentarios], [PedidoLineaEstado], [PedidoLineaFHInicio], [PedidoLineaFHFin], [PedidoLineaPrioridad], [ProductoId] FROM [PedidoLinea] WITH (NOLOCK) WHERE [PedidoId] = @PedidoId AND [PedidoLineaId] = @PedidoLineaId ",true, GxErrorMask.GX_NOMASK, false, this,prmT00013,1,0,true,false )
             ,new CursorDef("T00014", "SELECT [ProductoId] FROM [Producto] WITH (NOLOCK) WHERE [ProductoId] = @ProductoId ",true, GxErrorMask.GX_NOMASK, false, this,prmT00014,1,0,true,false )
             ,new CursorDef("T00016", "SELECT COALESCE( T1.[ProductoPrecio], 0) AS ProductoPrecio FROM (SELECT SUM(T2.[ProductoIngredienteCantidad] * CAST(T3.[IngredienteCosto] AS decimal( 10, 5))) AS ProductoPrecio, T2.[ProductoId] FROM ([ProductoIngrediente] T2 WITH (NOLOCK) INNER JOIN [Ingrediente] T3 WITH (NOLOCK) ON T3.[IngredienteId] = T2.[IngredienteId]) GROUP BY T2.[ProductoId] ) T1 WHERE T1.[ProductoId] = @ProductoId ",true, GxErrorMask.GX_NOMASK, false, this,prmT00016,1,0,true,false )
             ,new CursorDef("T00017", "SELECT [PedidoId], [PedidoCantidadPersonas], [PedidoEstado], [PedidoFHFin], [PedidoFHInicio], [PedidoTipo], [MesaId] FROM [Pedido] WITH (UPDLOCK) WHERE [PedidoId] = @PedidoId ",true, GxErrorMask.GX_NOMASK, false, this,prmT00017,1,0,true,false )
             ,new CursorDef("T00018", "SELECT [PedidoId], [PedidoCantidadPersonas], [PedidoEstado], [PedidoFHFin], [PedidoFHInicio], [PedidoTipo], [MesaId] FROM [Pedido] WITH (NOLOCK) WHERE [PedidoId] = @PedidoId ",true, GxErrorMask.GX_NOMASK, false, this,prmT00018,1,0,true,false )
             ,new CursorDef("T00019", "SELECT [MesaId] FROM [Mesa] WITH (NOLOCK) WHERE [MesaId] = @MesaId ",true, GxErrorMask.GX_NOMASK, false, this,prmT00019,1,0,true,false )
             ,new CursorDef("T000113", "SELECT COALESCE( T1.[ImporteTotal], 0) AS ImporteTotal FROM (SELECT SUM(COALESCE( T3.[LineaImporte], 0)) AS ImporteTotal, T2.[PedidoId] FROM ([PedidoLinea] T2 WITH (UPDLOCK) INNER JOIN (SELECT T4.[PedidoLineaCantidad] * CAST(( COALESCE( T5.[ProductoPrecio], 0)) AS decimal( 10, 5)) AS LineaImporte, T4.[PedidoId], T4.[PedidoLineaId] FROM ([PedidoLinea] T4 WITH (UPDLOCK) LEFT JOIN (SELECT SUM(T6.[ProductoIngredienteCantidad] * CAST(T7.[IngredienteCosto] AS decimal( 10, 5))) AS ProductoPrecio, T6.[ProductoId] FROM ([ProductoIngrediente] T6 WITH (NOLOCK) INNER JOIN [Ingrediente] T7 WITH (NOLOCK) ON T7.[IngredienteId] = T6.[IngredienteId]) GROUP BY T6.[ProductoId] ) T5 ON T5.[ProductoId] = T4.[ProductoId]) ) T3 ON T3.[PedidoId] = T2.[PedidoId] AND T3.[PedidoLineaId] = T2.[PedidoLineaId]) GROUP BY T2.[PedidoId] ) T1 WHERE T1.[PedidoId] = @PedidoId ",true, GxErrorMask.GX_NOMASK, false, this,prmT000113,1,0,true,false )
             ,new CursorDef("T000117", "SELECT TM1.[PedidoId], TM1.[PedidoCantidadPersonas], TM1.[PedidoEstado], TM1.[PedidoFHFin], TM1.[PedidoFHInicio], TM1.[PedidoTipo], TM1.[MesaId], COALESCE( T2.[ImporteTotal], 0) AS ImporteTotal FROM ([Pedido] TM1 WITH (NOLOCK) LEFT JOIN (SELECT SUM(COALESCE( T4.[LineaImporte], 0)) AS ImporteTotal, T3.[PedidoId] FROM ([PedidoLinea] T3 WITH (NOLOCK) INNER JOIN (SELECT T5.[PedidoLineaCantidad] * CAST(( COALESCE( T6.[ProductoPrecio], 0)) AS decimal( 10, 5)) AS LineaImporte, T5.[PedidoId], T5.[PedidoLineaId] FROM ([PedidoLinea] T5 WITH (NOLOCK) LEFT JOIN (SELECT SUM(T7.[ProductoIngredienteCantidad] * CAST(T8.[IngredienteCosto] AS decimal( 10, 5))) AS ProductoPrecio, T7.[ProductoId] FROM ([ProductoIngrediente] T7 WITH (NOLOCK) INNER JOIN [Ingrediente] T8 WITH (NOLOCK) ON T8.[IngredienteId] = T7.[IngredienteId]) GROUP BY T7.[ProductoId] ) T6 ON T6.[ProductoId] = T5.[ProductoId]) ) T4 ON T4.[PedidoId] = T3.[PedidoId] AND T4.[PedidoLineaId] = T3.[PedidoLineaId]) GROUP BY T3.[PedidoId] ) T2 ON T2.[PedidoId] = TM1.[PedidoId]) WHERE TM1.[PedidoId] = @PedidoId ORDER BY TM1.[PedidoId]  OPTION (FAST 100)",true, GxErrorMask.GX_NOMASK, false, this,prmT000117,100,0,true,false )
             ,new CursorDef("T000121", "SELECT COALESCE( T1.[ImporteTotal], 0) AS ImporteTotal FROM (SELECT SUM(COALESCE( T3.[LineaImporte], 0)) AS ImporteTotal, T2.[PedidoId] FROM ([PedidoLinea] T2 WITH (UPDLOCK) INNER JOIN (SELECT T4.[PedidoLineaCantidad] * CAST(( COALESCE( T5.[ProductoPrecio], 0)) AS decimal( 10, 5)) AS LineaImporte, T4.[PedidoId], T4.[PedidoLineaId] FROM ([PedidoLinea] T4 WITH (UPDLOCK) LEFT JOIN (SELECT SUM(T6.[ProductoIngredienteCantidad] * CAST(T7.[IngredienteCosto] AS decimal( 10, 5))) AS ProductoPrecio, T6.[ProductoId] FROM ([ProductoIngrediente] T6 WITH (NOLOCK) INNER JOIN [Ingrediente] T7 WITH (NOLOCK) ON T7.[IngredienteId] = T6.[IngredienteId]) GROUP BY T6.[ProductoId] ) T5 ON T5.[ProductoId] = T4.[ProductoId]) ) T3 ON T3.[PedidoId] = T2.[PedidoId] AND T3.[PedidoLineaId] = T2.[PedidoLineaId]) GROUP BY T2.[PedidoId] ) T1 WHERE T1.[PedidoId] = @PedidoId ",true, GxErrorMask.GX_NOMASK, false, this,prmT000121,1,0,true,false )
             ,new CursorDef("T000122", "SELECT [MesaId] FROM [Mesa] WITH (NOLOCK) WHERE [MesaId] = @MesaId ",true, GxErrorMask.GX_NOMASK, false, this,prmT000122,1,0,true,false )
             ,new CursorDef("T000123", "SELECT [PedidoId] FROM [Pedido] WITH (NOLOCK) WHERE [PedidoId] = @PedidoId  OPTION (FAST 1)",true, GxErrorMask.GX_NOMASK, false, this,prmT000123,1,0,true,false )
             ,new CursorDef("T000124", "SELECT TOP 1 [PedidoId] FROM [Pedido] WITH (NOLOCK) WHERE ( [PedidoId] > @PedidoId) ORDER BY [PedidoId]  OPTION (FAST 1)",true, GxErrorMask.GX_NOMASK, false, this,prmT000124,1,0,true,true )
             ,new CursorDef("T000125", "SELECT TOP 1 [PedidoId] FROM [Pedido] WITH (NOLOCK) WHERE ( [PedidoId] < @PedidoId) ORDER BY [PedidoId] DESC  OPTION (FAST 1)",true, GxErrorMask.GX_NOMASK, false, this,prmT000125,1,0,true,true )
             ,new CursorDef("T000126", "SELECT [PedidoId], [PedidoCantidadPersonas], [PedidoEstado], [PedidoFHFin], [PedidoFHInicio], [PedidoTipo], [MesaId] FROM [Pedido] WITH (UPDLOCK) WHERE [PedidoId] = @PedidoId ",true, GxErrorMask.GX_NOMASK, false, this,prmT000126,1,0,true,false )
             ,new CursorDef("T000127", "INSERT INTO [Pedido] ([PedidoId], [PedidoCantidadPersonas], [PedidoEstado], [PedidoFHFin], [PedidoFHInicio], [PedidoTipo], [MesaId]) VALUES (@PedidoId, @PedidoCantidadPersonas, @PedidoEstado, @PedidoFHFin, @PedidoFHInicio, @PedidoTipo, @MesaId)", GxErrorMask.GX_NOMASK,prmT000127)
             ,new CursorDef("T000128", "UPDATE [Pedido] SET [PedidoCantidadPersonas]=@PedidoCantidadPersonas, [PedidoEstado]=@PedidoEstado, [PedidoFHFin]=@PedidoFHFin, [PedidoFHInicio]=@PedidoFHInicio, [PedidoTipo]=@PedidoTipo, [MesaId]=@MesaId  WHERE [PedidoId] = @PedidoId", GxErrorMask.GX_NOMASK,prmT000128)
             ,new CursorDef("T000129", "DELETE FROM [Pedido]  WHERE [PedidoId] = @PedidoId", GxErrorMask.GX_NOMASK,prmT000129)
             ,new CursorDef("T000133", "SELECT COALESCE( T1.[ImporteTotal], 0) AS ImporteTotal FROM (SELECT SUM(COALESCE( T3.[LineaImporte], 0)) AS ImporteTotal, T2.[PedidoId] FROM ([PedidoLinea] T2 WITH (UPDLOCK) INNER JOIN (SELECT T4.[PedidoLineaCantidad] * CAST(( COALESCE( T5.[ProductoPrecio], 0)) AS decimal( 10, 5)) AS LineaImporte, T4.[PedidoId], T4.[PedidoLineaId] FROM ([PedidoLinea] T4 WITH (UPDLOCK) LEFT JOIN (SELECT SUM(T6.[ProductoIngredienteCantidad] * CAST(T7.[IngredienteCosto] AS decimal( 10, 5))) AS ProductoPrecio, T6.[ProductoId] FROM ([ProductoIngrediente] T6 WITH (NOLOCK) INNER JOIN [Ingrediente] T7 WITH (NOLOCK) ON T7.[IngredienteId] = T6.[IngredienteId]) GROUP BY T6.[ProductoId] ) T5 ON T5.[ProductoId] = T4.[ProductoId]) ) T3 ON T3.[PedidoId] = T2.[PedidoId] AND T3.[PedidoLineaId] = T2.[PedidoLineaId]) GROUP BY T2.[PedidoId] ) T1 WHERE T1.[PedidoId] = @PedidoId ",true, GxErrorMask.GX_NOMASK, false, this,prmT000133,1,0,true,false )
             ,new CursorDef("T000134", "SELECT [PedidoId] FROM [Pedido] WITH (NOLOCK) ORDER BY [PedidoId]  OPTION (FAST 100)",true, GxErrorMask.GX_NOMASK, false, this,prmT000134,100,0,true,false )
             ,new CursorDef("T000136", "SELECT T1.[PedidoId], T1.[PedidoLineaId], T1.[PedidoLineaCantidad], T1.[PedidoLineaComentarios], T1.[PedidoLineaEstado], T1.[PedidoLineaFHInicio], T1.[PedidoLineaFHFin], T1.[PedidoLineaPrioridad], T1.[ProductoId], COALESCE( T2.[ProductoPrecio], 0) AS ProductoPrecio FROM ([PedidoLinea] T1 WITH (NOLOCK) LEFT JOIN (SELECT SUM(T3.[ProductoIngredienteCantidad] * CAST(T4.[IngredienteCosto] AS decimal( 10, 5))) AS ProductoPrecio, T3.[ProductoId] FROM ([ProductoIngrediente] T3 WITH (NOLOCK) INNER JOIN [Ingrediente] T4 WITH (NOLOCK) ON T4.[IngredienteId] = T3.[IngredienteId]) GROUP BY T3.[ProductoId] ) T2 ON T2.[ProductoId] = T1.[ProductoId]) WHERE T1.[PedidoId] = @PedidoId and T1.[PedidoLineaId] = @PedidoLineaId ORDER BY T1.[PedidoId], T1.[PedidoLineaId] ",true, GxErrorMask.GX_NOMASK, false, this,prmT000136,11,0,true,false )
             ,new CursorDef("T000137", "SELECT [ProductoId] FROM [Producto] WITH (NOLOCK) WHERE [ProductoId] = @ProductoId ",true, GxErrorMask.GX_NOMASK, false, this,prmT000137,1,0,true,false )
             ,new CursorDef("T000139", "SELECT COALESCE( T1.[ProductoPrecio], 0) AS ProductoPrecio FROM (SELECT SUM(T2.[ProductoIngredienteCantidad] * CAST(T3.[IngredienteCosto] AS decimal( 10, 5))) AS ProductoPrecio, T2.[ProductoId] FROM ([ProductoIngrediente] T2 WITH (NOLOCK) INNER JOIN [Ingrediente] T3 WITH (NOLOCK) ON T3.[IngredienteId] = T2.[IngredienteId]) GROUP BY T2.[ProductoId] ) T1 WHERE T1.[ProductoId] = @ProductoId ",true, GxErrorMask.GX_NOMASK, false, this,prmT000139,1,0,true,false )
             ,new CursorDef("T000140", "SELECT [PedidoId], [PedidoLineaId] FROM [PedidoLinea] WITH (NOLOCK) WHERE [PedidoId] = @PedidoId AND [PedidoLineaId] = @PedidoLineaId ",true, GxErrorMask.GX_NOMASK, false, this,prmT000140,1,0,true,false )
             ,new CursorDef("T000141", "INSERT INTO [PedidoLinea] ([PedidoId], [PedidoLineaId], [PedidoLineaCantidad], [PedidoLineaComentarios], [PedidoLineaEstado], [PedidoLineaFHInicio], [PedidoLineaFHFin], [PedidoLineaPrioridad], [ProductoId]) VALUES (@PedidoId, @PedidoLineaId, @PedidoLineaCantidad, @PedidoLineaComentarios, @PedidoLineaEstado, @PedidoLineaFHInicio, @PedidoLineaFHFin, @PedidoLineaPrioridad, @ProductoId)", GxErrorMask.GX_NOMASK,prmT000141)
             ,new CursorDef("T000142", "UPDATE [PedidoLinea] SET [PedidoLineaCantidad]=@PedidoLineaCantidad, [PedidoLineaComentarios]=@PedidoLineaComentarios, [PedidoLineaEstado]=@PedidoLineaEstado, [PedidoLineaFHInicio]=@PedidoLineaFHInicio, [PedidoLineaFHFin]=@PedidoLineaFHFin, [PedidoLineaPrioridad]=@PedidoLineaPrioridad, [ProductoId]=@ProductoId  WHERE [PedidoId] = @PedidoId AND [PedidoLineaId] = @PedidoLineaId", GxErrorMask.GX_NOMASK,prmT000142)
             ,new CursorDef("T000143", "DELETE FROM [PedidoLinea]  WHERE [PedidoId] = @PedidoId AND [PedidoLineaId] = @PedidoLineaId", GxErrorMask.GX_NOMASK,prmT000143)
             ,new CursorDef("T000145", "SELECT COALESCE( T1.[ProductoPrecio], 0) AS ProductoPrecio FROM (SELECT SUM(T2.[ProductoIngredienteCantidad] * CAST(T3.[IngredienteCosto] AS decimal( 10, 5))) AS ProductoPrecio, T2.[ProductoId] FROM ([ProductoIngrediente] T2 WITH (NOLOCK) INNER JOIN [Ingrediente] T3 WITH (NOLOCK) ON T3.[IngredienteId] = T2.[IngredienteId]) GROUP BY T2.[ProductoId] ) T1 WHERE T1.[ProductoId] = @ProductoId ",true, GxErrorMask.GX_NOMASK, false, this,prmT000145,1,0,true,false )
             ,new CursorDef("T000146", "SELECT [PedidoId], [PedidoLineaId] FROM [PedidoLinea] WITH (NOLOCK) WHERE [PedidoId] = @PedidoId ORDER BY [PedidoId], [PedidoLineaId] ",true, GxErrorMask.GX_NOMASK, false, this,prmT000146,11,0,true,false )
             ,new CursorDef("T000147", "SELECT [MesaId] FROM [Mesa] WITH (NOLOCK) WHERE [MesaId] = @MesaId ",true, GxErrorMask.GX_NOMASK, false, this,prmT000147,1,0,true,false )
             ,new CursorDef("T000148", "SELECT [ProductoId] FROM [Producto] WITH (NOLOCK) WHERE [ProductoId] = @ProductoId ",true, GxErrorMask.GX_NOMASK, false, this,prmT000148,1,0,true,false )
          };
       }
    }

    public void getResults( int cursor ,
                            IFieldGetter rslt ,
                            Object[] buf )
    {
       switch ( cursor )
       {
             case 0 :
                ((long[]) buf[0])[0] = rslt.getLong(1) ;
                ((long[]) buf[1])[0] = rslt.getLong(2) ;
                ((short[]) buf[2])[0] = rslt.getShort(3) ;
                ((String[]) buf[3])[0] = rslt.getVarchar(4) ;
                ((String[]) buf[4])[0] = rslt.getString(5, 1) ;
                ((DateTime[]) buf[5])[0] = rslt.getGXDateTime(6) ;
                ((DateTime[]) buf[6])[0] = rslt.getGXDateTime(7) ;
                ((short[]) buf[7])[0] = rslt.getShort(8) ;
                ((long[]) buf[8])[0] = rslt.getLong(9) ;
                break;
             case 1 :
                ((long[]) buf[0])[0] = rslt.getLong(1) ;
                ((long[]) buf[1])[0] = rslt.getLong(2) ;
                ((short[]) buf[2])[0] = rslt.getShort(3) ;
                ((String[]) buf[3])[0] = rslt.getVarchar(4) ;
                ((String[]) buf[4])[0] = rslt.getString(5, 1) ;
                ((DateTime[]) buf[5])[0] = rslt.getGXDateTime(6) ;
                ((DateTime[]) buf[6])[0] = rslt.getGXDateTime(7) ;
                ((short[]) buf[7])[0] = rslt.getShort(8) ;
                ((long[]) buf[8])[0] = rslt.getLong(9) ;
                break;
             case 2 :
                ((long[]) buf[0])[0] = rslt.getLong(1) ;
                break;
             case 3 :
                ((decimal[]) buf[0])[0] = rslt.getDecimal(1) ;
                ((bool[]) buf[1])[0] = rslt.wasNull(1);
                break;
             case 4 :
                ((long[]) buf[0])[0] = rslt.getLong(1) ;
                ((short[]) buf[1])[0] = rslt.getShort(2) ;
                ((String[]) buf[2])[0] = rslt.getString(3, 1) ;
                ((DateTime[]) buf[3])[0] = rslt.getGXDateTime(4) ;
                ((DateTime[]) buf[4])[0] = rslt.getGXDateTime(5) ;
                ((String[]) buf[5])[0] = rslt.getString(6, 20) ;
                ((long[]) buf[6])[0] = rslt.getLong(7) ;
                break;
             case 5 :
                ((long[]) buf[0])[0] = rslt.getLong(1) ;
                ((short[]) buf[1])[0] = rslt.getShort(2) ;
                ((String[]) buf[2])[0] = rslt.getString(3, 1) ;
                ((DateTime[]) buf[3])[0] = rslt.getGXDateTime(4) ;
                ((DateTime[]) buf[4])[0] = rslt.getGXDateTime(5) ;
                ((String[]) buf[5])[0] = rslt.getString(6, 20) ;
                ((long[]) buf[6])[0] = rslt.getLong(7) ;
                break;
             case 6 :
                ((long[]) buf[0])[0] = rslt.getLong(1) ;
                break;
             case 7 :
                ((decimal[]) buf[0])[0] = rslt.getDecimal(1) ;
                ((bool[]) buf[1])[0] = rslt.wasNull(1);
                break;
             case 8 :
                ((long[]) buf[0])[0] = rslt.getLong(1) ;
                ((short[]) buf[1])[0] = rslt.getShort(2) ;
                ((String[]) buf[2])[0] = rslt.getString(3, 1) ;
                ((DateTime[]) buf[3])[0] = rslt.getGXDateTime(4) ;
                ((DateTime[]) buf[4])[0] = rslt.getGXDateTime(5) ;
                ((String[]) buf[5])[0] = rslt.getString(6, 20) ;
                ((long[]) buf[6])[0] = rslt.getLong(7) ;
                ((decimal[]) buf[7])[0] = rslt.getDecimal(8) ;
                ((bool[]) buf[8])[0] = rslt.wasNull(8);
                break;
             case 9 :
                ((decimal[]) buf[0])[0] = rslt.getDecimal(1) ;
                ((bool[]) buf[1])[0] = rslt.wasNull(1);
                break;
             case 10 :
                ((long[]) buf[0])[0] = rslt.getLong(1) ;
                break;
             case 11 :
                ((long[]) buf[0])[0] = rslt.getLong(1) ;
                break;
             case 12 :
                ((long[]) buf[0])[0] = rslt.getLong(1) ;
                break;
             case 13 :
                ((long[]) buf[0])[0] = rslt.getLong(1) ;
                break;
             case 14 :
                ((long[]) buf[0])[0] = rslt.getLong(1) ;
                ((short[]) buf[1])[0] = rslt.getShort(2) ;
                ((String[]) buf[2])[0] = rslt.getString(3, 1) ;
                ((DateTime[]) buf[3])[0] = rslt.getGXDateTime(4) ;
                ((DateTime[]) buf[4])[0] = rslt.getGXDateTime(5) ;
                ((String[]) buf[5])[0] = rslt.getString(6, 20) ;
                ((long[]) buf[6])[0] = rslt.getLong(7) ;
                break;
             case 18 :
                ((decimal[]) buf[0])[0] = rslt.getDecimal(1) ;
                ((bool[]) buf[1])[0] = rslt.wasNull(1);
                break;
             case 19 :
                ((long[]) buf[0])[0] = rslt.getLong(1) ;
                break;
             case 20 :
                ((long[]) buf[0])[0] = rslt.getLong(1) ;
                ((long[]) buf[1])[0] = rslt.getLong(2) ;
                ((short[]) buf[2])[0] = rslt.getShort(3) ;
                ((String[]) buf[3])[0] = rslt.getVarchar(4) ;
                ((String[]) buf[4])[0] = rslt.getString(5, 1) ;
                ((DateTime[]) buf[5])[0] = rslt.getGXDateTime(6) ;
                ((DateTime[]) buf[6])[0] = rslt.getGXDateTime(7) ;
                ((short[]) buf[7])[0] = rslt.getShort(8) ;
                ((long[]) buf[8])[0] = rslt.getLong(9) ;
                ((bool[]) buf[9])[0] = rslt.wasNull(9);
                ((decimal[]) buf[10])[0] = rslt.getDecimal(10) ;
                ((bool[]) buf[11])[0] = rslt.wasNull(10);
                break;
             case 21 :
                ((long[]) buf[0])[0] = rslt.getLong(1) ;
                break;
             case 22 :
                ((decimal[]) buf[0])[0] = rslt.getDecimal(1) ;
                ((bool[]) buf[1])[0] = rslt.wasNull(1);
                break;
             case 23 :
                ((long[]) buf[0])[0] = rslt.getLong(1) ;
                ((long[]) buf[1])[0] = rslt.getLong(2) ;
                break;
             case 27 :
                ((decimal[]) buf[0])[0] = rslt.getDecimal(1) ;
                ((bool[]) buf[1])[0] = rslt.wasNull(1);
                break;
             case 28 :
                ((long[]) buf[0])[0] = rslt.getLong(1) ;
                ((long[]) buf[1])[0] = rslt.getLong(2) ;
                break;
             case 29 :
                ((long[]) buf[0])[0] = rslt.getLong(1) ;
                break;
             case 30 :
                ((long[]) buf[0])[0] = rslt.getLong(1) ;
                break;
       }
    }

    public void setParameters( int cursor ,
                               IFieldSetter stmt ,
                               Object[] parms )
    {
       switch ( cursor )
       {
             case 0 :
                stmt.SetParameter(1, (long)parms[0]);
                stmt.SetParameter(2, (long)parms[1]);
                break;
             case 1 :
                stmt.SetParameter(1, (long)parms[0]);
                stmt.SetParameter(2, (long)parms[1]);
                break;
             case 2 :
                if ( (bool)parms[0] )
                {
                   stmt.setNull( 1 , SqlDbType.Decimal );
                }
                else
                {
                   stmt.SetParameter(1, (long)parms[1]);
                }
                break;
             case 3 :
                if ( (bool)parms[0] )
                {
                   stmt.setNull( 1 , SqlDbType.Decimal );
                }
                else
                {
                   stmt.SetParameter(1, (long)parms[1]);
                }
                break;
             case 4 :
                stmt.SetParameter(1, (long)parms[0]);
                break;
             case 5 :
                stmt.SetParameter(1, (long)parms[0]);
                break;
             case 6 :
                stmt.SetParameter(1, (long)parms[0]);
                break;
             case 7 :
                stmt.SetParameter(1, (long)parms[0]);
                break;
             case 8 :
                stmt.SetParameter(1, (long)parms[0]);
                break;
             case 9 :
                stmt.SetParameter(1, (long)parms[0]);
                break;
             case 10 :
                stmt.SetParameter(1, (long)parms[0]);
                break;
             case 11 :
                stmt.SetParameter(1, (long)parms[0]);
                break;
             case 12 :
                stmt.SetParameter(1, (long)parms[0]);
                break;
             case 13 :
                stmt.SetParameter(1, (long)parms[0]);
                break;
             case 14 :
                stmt.SetParameter(1, (long)parms[0]);
                break;
             case 15 :
                stmt.SetParameter(1, (long)parms[0]);
                stmt.SetParameter(2, (short)parms[1]);
                stmt.SetParameter(3, (String)parms[2]);
                stmt.SetParameterDatetime(4, (DateTime)parms[3]);
                stmt.SetParameterDatetime(5, (DateTime)parms[4]);
                stmt.SetParameter(6, (String)parms[5]);
                stmt.SetParameter(7, (long)parms[6]);
                break;
             case 16 :
                stmt.SetParameter(1, (short)parms[0]);
                stmt.SetParameter(2, (String)parms[1]);
                stmt.SetParameterDatetime(3, (DateTime)parms[2]);
                stmt.SetParameterDatetime(4, (DateTime)parms[3]);
                stmt.SetParameter(5, (String)parms[4]);
                stmt.SetParameter(6, (long)parms[5]);
                stmt.SetParameter(7, (long)parms[6]);
                break;
             case 17 :
                stmt.SetParameter(1, (long)parms[0]);
                break;
             case 18 :
                stmt.SetParameter(1, (long)parms[0]);
                break;
             case 20 :
                stmt.SetParameter(1, (long)parms[0]);
                stmt.SetParameter(2, (long)parms[1]);
                break;
             case 21 :
                if ( (bool)parms[0] )
                {
                   stmt.setNull( 1 , SqlDbType.Decimal );
                }
                else
                {
                   stmt.SetParameter(1, (long)parms[1]);
                }
                break;
             case 22 :
                if ( (bool)parms[0] )
                {
                   stmt.setNull( 1 , SqlDbType.Decimal );
                }
                else
                {
                   stmt.SetParameter(1, (long)parms[1]);
                }
                break;
             case 23 :
                stmt.SetParameter(1, (long)parms[0]);
                stmt.SetParameter(2, (long)parms[1]);
                break;
             case 24 :
                stmt.SetParameter(1, (long)parms[0]);
                stmt.SetParameter(2, (long)parms[1]);
                stmt.SetParameter(3, (short)parms[2]);
                stmt.SetParameter(4, (String)parms[3]);
                stmt.SetParameter(5, (String)parms[4]);
                stmt.SetParameterDatetime(6, (DateTime)parms[5]);
                stmt.SetParameterDatetime(7, (DateTime)parms[6]);
                stmt.SetParameter(8, (short)parms[7]);
                if ( (bool)parms[8] )
                {
                   stmt.setNull( 9 , SqlDbType.Decimal );
                }
                else
                {
                   stmt.SetParameter(9, (long)parms[9]);
                }
                break;
             case 25 :
                stmt.SetParameter(1, (short)parms[0]);
                stmt.SetParameter(2, (String)parms[1]);
                stmt.SetParameter(3, (String)parms[2]);
                stmt.SetParameterDatetime(4, (DateTime)parms[3]);
                stmt.SetParameterDatetime(5, (DateTime)parms[4]);
                stmt.SetParameter(6, (short)parms[5]);
                if ( (bool)parms[6] )
                {
                   stmt.setNull( 7 , SqlDbType.Decimal );
                }
                else
                {
                   stmt.SetParameter(7, (long)parms[7]);
                }
                stmt.SetParameter(8, (long)parms[8]);
                stmt.SetParameter(9, (long)parms[9]);
                break;
             case 26 :
                stmt.SetParameter(1, (long)parms[0]);
                stmt.SetParameter(2, (long)parms[1]);
                break;
             case 27 :
                if ( (bool)parms[0] )
                {
                   stmt.setNull( 1 , SqlDbType.Decimal );
                }
                else
                {
                   stmt.SetParameter(1, (long)parms[1]);
                }
                break;
             case 28 :
                stmt.SetParameter(1, (long)parms[0]);
                break;
             case 29 :
                stmt.SetParameter(1, (long)parms[0]);
                break;
             case 30 :
                if ( (bool)parms[0] )
                {
                   stmt.setNull( 1 , SqlDbType.Decimal );
                }
                else
                {
                   stmt.SetParameter(1, (long)parms[1]);
                }
                break;
       }
    }

 }

}
